diff --git a/runelite-client/src/main/java/net/runelite/client/callback/Hooks.java b/runelite-client/src/main/java/net/runelite/client/callback/Hooks.java index 459ac6e3d6..eccf79c46e 100644 --- a/runelite-client/src/main/java/net/runelite/client/callback/Hooks.java +++ b/runelite-client/src/main/java/net/runelite/client/callback/Hooks.java @@ -95,9 +95,16 @@ public class Hooks private static Graphics2D stretchedGraphics; private static long lastCheck; + private static boolean shouldProcessGameTick; public static void clientMainLoop(Client client, boolean arg1) { + if (shouldProcessGameTick) + { + shouldProcessGameTick = false; + eventBus.post(tick); + } + clientThread.invoke(); long now = System.currentTimeMillis(); @@ -403,7 +410,10 @@ public class Hooks public static void onNpcUpdate(boolean var0, PacketBuffer var1) { - eventBus.post(tick); + // The NPC update event seem to run every server tick, + // but having the game tick event after all packets + // have been processed is typically more useful. + shouldProcessGameTick = true; } public static void onSetCombatInfo(Actor actor, int combatInfoId, int gameCycle, int var3, int var4, int healthRatio, int health)