diff options
author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2024-04-04 04:56:02 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-03 19:56:02 +0200 |
commit | 1d051f3e1e35489989ca109f1493154641c23068 (patch) | |
tree | a3df2f70828ce87f487f43d6956718ab4c261838 /src/main/java/at/hannibal2/skyhanni/data | |
parent | 14980034dd0fb71973e15c40e1a8a6f4eaa29895 (diff) | |
download | skyhanni-1d051f3e1e35489989ca109f1493154641c23068.tar.gz skyhanni-1d051f3e1e35489989ca109f1493154641c23068.tar.bz2 skyhanni-1d051f3e1e35489989ca109f1493154641c23068.zip |
Fix: Tick event being called twice a tick (#1342)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt | 3 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt index 6720c81eb..7fc50447f 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt @@ -276,7 +276,6 @@ class HypixelData { // So, as requested by Hannibal, use locraw from // NEU and have NEU send it. // Remove this when NEU dependency is removed - val currentTime = System.currentTimeMillis() if (LorenzUtils.onHypixel && locrawData == null && lastLocRaw.passedSince() > 15.seconds @@ -289,7 +288,7 @@ class HypixelData { } } - if (event.isMod(2) && LorenzUtils.inSkyBlock) { + if (LorenzUtils.inSkyBlock) { val originalLocation = ScoreboardData.sidebarLinesFormatted .firstOrNull { it.startsWith(" §7⏣ ") || it.startsWith(" §5ф ") } ?.substring(5)?.removeColor() diff --git a/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt b/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt index 2ec0ea667..bc0f31e2f 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt @@ -69,14 +69,16 @@ object MinecraftData { @SubscribeEvent fun onTick(event: TickEvent.ClientTickEvent) { + if (event.phase == TickEvent.Phase.START) return Minecraft.getMinecraft().thePlayer ?: return + + DelayedRun.checkRuns() totalTicks++ LorenzTickEvent(totalTicks).postAndCatch() } @SubscribeEvent fun onTick(event: LorenzTickEvent) { - DelayedRun.checkRuns() if (!LorenzUtils.inSkyBlock) return val hand = InventoryUtils.getItemInHand() val newItem = hand?.getInternalName() ?: NEUInternalName.NONE |