aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/util/SBData.kt
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-10-07 15:08:18 +0200
committerLinnea Gräf <nea@nea.moe>2024-10-07 15:08:18 +0200
commitdaa63bd914a2f6c5e9b668abb8474884685ee818 (patch)
treeaf0d6394023d602c92acec109b5cb405c99d38f8 /src/main/kotlin/util/SBData.kt
parenta8d5fed7d2994f86affb46774a463bb063a36c2b (diff)
downloadFirmament-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/SBData.kt')
-rw-r--r--src/main/kotlin/util/SBData.kt5
1 files changed, 5 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))
+ }
}
}
}