diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-01-07 03:11:17 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-01-07 03:11:17 +0100 |
commit | 0c711242c8d96517e49e0ecc7a081f8e15cdd7ed (patch) | |
tree | b890f54d39478f0dab45e9fa986eae01d4de7ca3 /src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt | |
parent | ce0956ac232f444724f90f0633b4b35f3dd8cfdf (diff) | |
download | skyhanni-0c711242c8d96517e49e0ecc7a081f8e15cdd7ed.tar.gz skyhanni-0c711242c8d96517e49e0ecc7a081f8e15cdd7ed.tar.bz2 skyhanni-0c711242c8d96517e49e0ecc7a081f8e15cdd7ed.zip |
Introduced IslandType enum.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt b/src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt index e1c466762..24738893f 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt @@ -17,7 +17,7 @@ class HyPixelData { companion object { var hypixel = false var skyBlock = false - var skyBlockIsland: String = "" + var skyBlockIsland = IslandType.UNKNOWN //Ironman, Stranded and Bingo var noTrade = false @@ -133,14 +133,24 @@ class HyPixelData { guesting = true } } - if (guesting) { - newIsland = "$newIsland guesting" + + var islandType = IslandType.getBySidebarName(newIsland) + + if (islandType == IslandType.PRIVATE_ISLAND) { + if (guesting) { + islandType = IslandType.PRIVATE_ISLAND_GUEST + } } - if (skyBlockIsland != newIsland) { - IslandChangeEvent(newIsland, skyBlockIsland).postAndCatch() - loggerIslandChange.log(newIsland) - skyBlockIsland = newIsland + if (skyBlockIsland != islandType) { + IslandChangeEvent(islandType, skyBlockIsland).postAndCatch() + if (islandType == IslandType.UNKNOWN) { + println("Unknown island detected: '$newIsland'") + loggerIslandChange.log("Unknown: '$newIsland'") + } else { + loggerIslandChange.log(islandType.name) + } + skyBlockIsland = islandType } } |