Skip to content

Commit

Permalink
Fix: Hypixel detection via Scoreboard (hannibal002#2131)
Browse files Browse the repository at this point in the history
Co-authored-by: hannibal2 <[email protected]>
  • Loading branch information
martimavocado and hannibal002 authored Jun 20, 2024
1 parent 1fcbcba commit 6a55631
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -113,6 +114,7 @@ object HypixelData {
)

private var lastLocRaw = SimpleTimeMark.farPast()
private var hasScoreboardUpdated = false

var hypixelLive = false
var hypixelAlpha = false
Expand Down Expand Up @@ -272,6 +274,12 @@ object HypixelData {
locrawData = null
skyBlockArea = null
skyBlockAreaWithSymbol = null
hasScoreboardUpdated = false
}

@SubscribeEvent
fun onScoreboardUpdate(event: ScoreboardUpdateEvent) {
hasScoreboardUpdated = true
}

@SubscribeEvent
Expand Down Expand Up @@ -378,6 +386,7 @@ object HypixelData {
}

private fun checkHypixel() {
if (!hasScoreboardUpdated) return
val mc = Minecraft.getMinecraft()
val player = mc.thePlayer ?: return

Expand Down

0 comments on commit 6a55631

Please sign in to comment.