Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lunaynx committed Dec 12, 2024
1 parent 6e62f3f commit 949ac86
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ object Ping {
}
}

@SubscribeEvent
fun onHypixelPacketFail(event: HypixelPacketEvent.FailedEvent) {
if (lastPingAt > 0 && event.type == "hypixel:ping") {
lastPingAt *= -1
invokedCommand = false
}
}

class PingDisplayElement : GuiElement(name = "Ping Display", x = 10, y = 10) {
override fun render() {
if (Utils.isOnHypixel && toggled && mc.thePlayer != null) {
Expand All @@ -119,7 +127,7 @@ object Ping {
}

2 -> {
if (lastPingAt < 0 && System.nanoTime() - lastPingAt.absoluteValue > 1_000_000L * 5_000) {
if (lastPingAt < 0 && System.nanoTime() - lastPingAt.absoluteValue > 1_000_000L * 6_000) {
sendPing()
}
}
Expand Down

0 comments on commit 949ac86

Please sign in to comment.