diff options
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 |