diff options
author | Luna <me@alexia.lol> | 2024-04-12 14:13:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-12 14:13:31 +0200 |
commit | 388819e61cf1229ef4a5d6ddeca1bd1dafd05e71 (patch) | |
tree | d23327bb36d749fa090a4666c2502335b9e2e800 /src | |
parent | 2038424a4ade6f5b85942d7eeb9d0ace485e6d46 (diff) | |
download | skyhanni-388819e61cf1229ef4a5d6ddeca1bd1dafd05e71.tar.gz skyhanni-388819e61cf1229ef4a5d6ddeca1bd1dafd05e71.tar.bz2 skyhanni-388819e61cf1229ef4a5d6ddeca1bd1dafd05e71.zip |
Fix: Clear SkyBlock area on world change (#1421)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src')
5 files changed, 9 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt index 8df208c95..7db5c9a89 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt @@ -112,8 +112,8 @@ class HypixelData { var profileName = "" var joinedWorld = SimpleTimeMark.farPast() - var skyBlockArea = "?" - var skyBlockAreaWithSymbol = "?" + var skyBlockArea: String? = null + var skyBlockAreaWithSymbol: String? = null // Data from locraw var locrawData: JsonObject? = null @@ -229,6 +229,8 @@ class HypixelData { locraw.forEach { locraw[it.key] = "" } joinedWorld = SimpleTimeMark.now() serverId = null + skyBlockArea = null + skyBlockAreaWithSymbol = null } @SubscribeEvent @@ -239,6 +241,8 @@ class HypixelData { inLobby = false locraw.forEach { locraw[it.key] = "" } locrawData = null + skyBlockArea = null + skyBlockAreaWithSymbol = null } @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/easter/EasterEggWaypoints.kt b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/easter/EasterEggWaypoints.kt index 4fc8d40f4..0017e9098 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/easter/EasterEggWaypoints.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/easter/EasterEggWaypoints.kt @@ -75,10 +75,7 @@ class EasterEggWaypoints { event.drawWaypointFilled(eggEntrance.waypoint, LorenzColor.YELLOW.toColor()) event.drawDynamicText(eggEntrance.waypoint, "§e" + eggEntrance.eggEntranceName, 1.5) } - return } - - if (LorenzUtils.skyBlockArea == "?") return } private fun EasterEgg.shouldShow(): Boolean { diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt index 2bf173ab9..6de6ea4f0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt @@ -483,7 +483,7 @@ private fun getIslandDisplayPair() = listOf("§7㋖ §a" + HypixelData.skyBlockIsland.displayName to HorizontalAlignment.LEFT) private fun getLocationDisplayPair() = buildList { - add(HypixelData.skyBlockAreaWithSymbol to HorizontalAlignment.LEFT) + HypixelData.skyBlockAreaWithSymbol?.let { add(it to HorizontalAlignment.LEFT) } ScoreboardData.sidebarLinesFormatted.firstOrNull { ScoreboardPattern.plotPattern.matches(it) } ?.let { add(it to HorizontalAlignment.LEFT) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt index e5741807b..77e854646 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt @@ -58,7 +58,7 @@ enum class DiscordStatus(private val displayMessageSupplier: Supplier<String>?) NONE(null), LOCATION({ - var location = LorenzUtils.skyBlockArea + var location = LorenzUtils.skyBlockArea ?: "invalid" val island = LorenzUtils.skyBlockIsland if (location == "Your Island") location = "Private Island" diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt index bf258dab9..7e349aa9f 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt @@ -58,7 +58,7 @@ object LorenzUtils { */ val skyBlockIsland get() = HypixelData.skyBlockIsland - val skyBlockArea get() = if (inSkyBlock) HypixelData.skyBlockArea else "?" + val skyBlockArea get() = if (inSkyBlock) HypixelData.skyBlockArea else null val inKuudraFight get() = inSkyBlock && KuudraAPI.inKuudra() |