From 6a55631dbb7e88461622ac975fdeb4bef49c48f6 Mon Sep 17 00:00:00 2001 From: martimavocado <39881008+martimavocado@users.noreply.github.com> Date: Thu, 20 Jun 2024 18:47:29 +0100 Subject: Fix: Hypixel detection via Scoreboard (#2131) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/main/java/at') 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 -- cgit