diff options
author | Linnea Gräf <nea@nea.moe> | 2024-10-07 15:08:18 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-10-07 15:08:18 +0200 |
commit | daa63bd914a2f6c5e9b668abb8474884685ee818 (patch) | |
tree | af0d6394023d602c92acec109b5cb405c99d38f8 /src/main/kotlin/util | |
parent | a8d5fed7d2994f86affb46774a463bb063a36c2b (diff) | |
download | Firmament-daa63bd914a2f6c5e9b668abb8474884685ee818.tar.gz Firmament-daa63bd914a2f6c5e9b668abb8474884685ee818.tar.bz2 Firmament-daa63bd914a2f6c5e9b668abb8474884685ee818.zip |
Fix drill ability cooldown resetting on world swap
Diffstat (limited to 'src/main/kotlin/util')
-rw-r--r-- | src/main/kotlin/util/SBData.kt | 5 | ||||
-rw-r--r-- | src/main/kotlin/util/SkyBlockIsland.kt | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/main/kotlin/util/SBData.kt b/src/main/kotlin/util/SBData.kt index 353bb06..0b2c404 100644 --- a/src/main/kotlin/util/SBData.kt +++ b/src/main/kotlin/util/SBData.kt @@ -7,6 +7,7 @@ import kotlin.jvm.optionals.getOrNull import kotlin.time.Duration.Companion.seconds import moe.nea.firmament.events.AllowChatEvent import moe.nea.firmament.events.ProcessChatEvent +import moe.nea.firmament.events.ProfileSwitchEvent import moe.nea.firmament.events.ServerConnectedEvent import moe.nea.firmament.events.SkyblockServerUpdateEvent import moe.nea.firmament.events.WorldReadyEvent @@ -54,6 +55,7 @@ object SBData { ProcessChatEvent.subscribe(receivesCancelled = true, "SBData:loadProfile") { event -> val profileMatch = profileRegex.matchEntire(event.unformattedString) if (profileMatch != null) { + val oldProfile = profileId try { profileId = UUID.fromString(profileMatch.groupValues[1]) hasReceivedProfile = true @@ -61,6 +63,9 @@ object SBData { profileId = null e.printStackTrace() } + if (oldProfile != profileId) { + ProfileSwitchEvent.publish(ProfileSwitchEvent(oldProfile, profileId)) + } } } } diff --git a/src/main/kotlin/util/SkyBlockIsland.kt b/src/main/kotlin/util/SkyBlockIsland.kt index bd0567d..c42a55c 100644 --- a/src/main/kotlin/util/SkyBlockIsland.kt +++ b/src/main/kotlin/util/SkyBlockIsland.kt @@ -34,6 +34,7 @@ private constructor( val HUB = forMode("hub") val PRIVATE_ISLAND = forMode("dynamic") val RIFT = forMode("rift") + val MINESHAFT = forMode("mineshaft") } val userFriendlyName |