aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt
diff options
context:
space:
mode:
authorRoman / Linnea Gräf <nea@nea.moe>2023-03-19 17:58:54 +0100
committerGitHub <noreply@github.com>2023-03-19 17:58:54 +0100
commit86d6cc6bf29172fb13ed6aab2ca0676631336da9 (patch)
treed5e0fc0aa6a556c44f497d818f36e674a0f2e317 /src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt
parent4d3e68e8777ac174b938ad63c3367a20e99e06ac (diff)
parent6913b635b9d20cc6736aef64bad9f5d517a2f644 (diff)
downloadSkyHanni-yaw_snapping.tar.gz
SkyHanni-yaw_snapping.tar.bz2
SkyHanni-yaw_snapping.zip
Merge branch 'beta' into yaw_snappingyaw_snapping
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt b/src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt
index 2893e67a4..b98664a2a 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt
@@ -26,7 +26,7 @@ class HyPixelData {
var stranded = false
var bingo = false
- var profile = ""
+ var profileName = ""
fun readSkyBlockArea(): String {
return ScoreboardData.sidebarLinesFormatted
@@ -64,13 +64,13 @@ class HyPixelData {
val message = event.message.removeColor().lowercase()
if (message.startsWith("your profile was changed to:")) {
val newProfile = message.replace("your profile was changed to:", "").replace("(co-op)", "").trim()
- profile = newProfile
+ profileName = newProfile
ProfileJoinEvent(newProfile).postAndCatch()
}
if (message.startsWith("you are playing on profile:")) {
val newProfile = message.replace("you are playing on profile:", "").replace("(co-op)", "").trim()
- if (profile == newProfile) return
- profile = newProfile
+ if (profileName == newProfile) return
+ profileName = newProfile
ProfileJoinEvent(newProfile).postAndCatch()
}
}
@@ -112,8 +112,6 @@ class HyPixelData {
bingo = true
}
- // TODO implemennt stranded check
-
" §7♲ §7Ironman" -> {
ironman = true
}
@@ -139,14 +137,7 @@ class HyPixelData {
}
}
- var islandType = IslandType.getBySidebarName(newIsland)
-
- if (islandType == IslandType.PRIVATE_ISLAND) {
- if (guesting) {
- islandType = IslandType.PRIVATE_ISLAND_GUEST
- }
- }
-
+ val islandType = getIslandType(newIsland, guesting)
if (skyBlockIsland != islandType) {
IslandChangeEvent(islandType, skyBlockIsland).postAndCatch()
if (islandType == IslandType.UNKNOWN) {
@@ -159,6 +150,15 @@ class HyPixelData {
}
}
+ private fun getIslandType(newIsland: String, guesting: Boolean): IslandType {
+ val islandType = IslandType.getBySidebarName(newIsland)
+ if (guesting) {
+ if (islandType == IslandType.PRIVATE_ISLAND) return IslandType.PRIVATE_ISLAND_GUEST
+ if (islandType == IslandType.GARDEN) return IslandType.GARDEN_GUEST
+ }
+ return islandType
+ }
+
private fun checkScoreboard(): Boolean {
val minecraft = Minecraft.getMinecraft()
val world = minecraft.theWorld ?: return false