diff options
author | martimavocado <39881008+martimavocado@users.noreply.github.com> | 2024-06-20 18:47:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-20 19:47:29 +0200 |
commit | 6a55631dbb7e88461622ac975fdeb4bef49c48f6 (patch) | |
tree | ea5906d2fcccf789c7aa08854e4877b80ed884c8 | |
parent | 1fcbcbaf51069cc37ab429561d34cbb4dd3c5723 (diff) | |
download | skyhanni-6a55631dbb7e88461622ac975fdeb4bef49c48f6.tar.gz skyhanni-6a55631dbb7e88461622ac975fdeb4bef49c48f6.tar.bz2 skyhanni-6a55631dbb7e88461622ac975fdeb4bef49c48f6.zip |
Fix: Hypixel detection via Scoreboard (#2131)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt index f922ce497..fdd4d23d2 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt @@ -10,6 +10,7 @@ import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.events.ProfileJoinEvent +import at.hannibal2.skyhanni.events.ScoreboardUpdateEvent import at.hannibal2.skyhanni.events.TabListUpdateEvent import at.hannibal2.skyhanni.events.WidgetUpdateEvent import at.hannibal2.skyhanni.events.minecraft.ClientDisconnectEvent @@ -113,6 +114,7 @@ object HypixelData { ) private var lastLocRaw = SimpleTimeMark.farPast() + private var hasScoreboardUpdated = false var hypixelLive = false var hypixelAlpha = false @@ -272,6 +274,12 @@ object HypixelData { locrawData = null skyBlockArea = null skyBlockAreaWithSymbol = null + hasScoreboardUpdated = false + } + + @SubscribeEvent + fun onScoreboardUpdate(event: ScoreboardUpdateEvent) { + hasScoreboardUpdated = true } @SubscribeEvent @@ -378,6 +386,7 @@ object HypixelData { } private fun checkHypixel() { + if (!hasScoreboardUpdated) return val mc = Minecraft.getMinecraft() val player = mc.thePlayer ?: return |