aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/util/SBData.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/util/SBData.kt')
-rw-r--r--src/main/kotlin/util/SBData.kt8
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 {