diff options
author | Linnea Gräf <nea@nea.moe> | 2024-09-01 22:21:19 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-09-01 22:21:19 +0200 |
commit | 5ed74f2df49c93ed1617520a935078b59ad7e195 (patch) | |
tree | f0d52699fff7f820bd724902878988859bd43516 /src/main/kotlin/util/SBData.kt | |
parent | 816f80f862d2f5de6bc9b0ae84cd6df0da341228 (diff) | |
download | Firmament-5ed74f2df49c93ed1617520a935078b59ad7e195.tar.gz Firmament-5ed74f2df49c93ed1617520a935078b59ad7e195.tar.bz2 Firmament-5ed74f2df49c93ed1617520a935078b59ad7e195.zip |
Add per compat project event listeners
[no changelog]
Diffstat (limited to 'src/main/kotlin/util/SBData.kt')
-rw-r--r-- | src/main/kotlin/util/SBData.kt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/kotlin/util/SBData.kt b/src/main/kotlin/util/SBData.kt index b30c6fb..5af8548 100644 --- a/src/main/kotlin/util/SBData.kt +++ b/src/main/kotlin/util/SBData.kt @@ -26,7 +26,7 @@ object SBData { val isOnSkyblock get() = locraw?.gametype == "SKYBLOCK" var lastProfileIdRequest = TimeMark.farPast() fun init() { - ServerConnectedEvent.subscribe { + ServerConnectedEvent.subscribe("SBData:onServerConnected") { HypixelModAPI.getInstance().subscribeToEventPacket(ClientboundLocationPacket::class.java) } HypixelModAPI.getInstance().createHandler(ClientboundLocationPacket::class.java) { @@ -39,18 +39,18 @@ object SBData { SkyblockServerUpdateEvent.publish(SkyblockServerUpdateEvent(lastLocraw, null)) } } - SkyblockServerUpdateEvent.subscribe { + SkyblockServerUpdateEvent.subscribe("SBData:sendProfileId") { if (!hasReceivedProfile && isOnSkyblock && lastProfileIdRequest.passedTime() > 30.seconds) { lastProfileIdRequest = TimeMark.now() MC.sendServerCommand("profileid") } } - AllowChatEvent.subscribe { event -> + AllowChatEvent.subscribe("SBData:hideProfileSuggest") { event -> if (event.unformattedString in profileSuggestTexts && lastProfileIdRequest.passedTime() < 5.seconds) { event.cancel() } } - ProcessChatEvent.subscribe(receivesCancelled = true) { event -> + ProcessChatEvent.subscribe(receivesCancelled = true, "SBData:loadProfile") { event -> val profileMatch = profileRegex.matchEntire(event.unformattedString) if (profileMatch != null) { try { |