diff options
author | Linnea Gräf <nea@nea.moe> | 2025-01-12 18:11:26 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2025-01-12 18:11:26 +0100 |
commit | cd5f6fbe2c0c7cabcc5362b8924d78f7b2b751fa (patch) | |
tree | e255656092c82754185735e0a4950dae5995fda3 /src/main/kotlin/util | |
parent | 383e2b8f7d529ef09496b1407a3cdee6dfc587b6 (diff) | |
download | Firmament-cd5f6fbe2c0c7cabcc5362b8924d78f7b2b751fa.tar.gz Firmament-cd5f6fbe2c0c7cabcc5362b8924d78f7b2b751fa.tar.bz2 Firmament-cd5f6fbe2c0c7cabcc5362b8924d78f7b2b751fa.zip |
fix: profile detection not applying when leaving skyblock
Diffstat (limited to 'src/main/kotlin/util')
-rw-r--r-- | src/main/kotlin/util/SBData.kt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/kotlin/util/SBData.kt b/src/main/kotlin/util/SBData.kt index e785ff6..b2f9449 100644 --- a/src/main/kotlin/util/SBData.kt +++ b/src/main/kotlin/util/SBData.kt @@ -19,6 +19,11 @@ object SBData { "CLICK THIS TO SUGGEST IT IN CHAT [NO DASHES]", ) var profileId: UUID? = null + get() { + // TODO: allow unfiltered access to this somehow + if (!isOnSkyblock) return null + return field + } /** * Source: https://hypixel-skyblock.fandom.com/wiki/Time_Systems @@ -37,11 +42,15 @@ object SBData { HypixelModAPI.getInstance().createHandler(ClientboundLocationPacket::class.java) { MC.onMainThread { val lastLocraw = locraw + val oldProfileId = profileId locraw = Locraw(it.serverName, it.serverType.getOrNull()?.name?.uppercase(), it.mode.getOrNull(), it.map.getOrNull()) SkyblockServerUpdateEvent.publish(SkyblockServerUpdateEvent(lastLocraw, locraw)) + if(oldProfileId != profileId) { + ProfileSwitchEvent.publish(ProfileSwitchEvent(oldProfileId, profileId)) + } profileIdCommandDebounce = TimeMark.now() } } |