Move updateNpcs call to mixins

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2018-06-22 10:46:38 +02:00
parent 8fb285f928
commit 2944e5b334
3 changed files with 14 additions and 2 deletions

View File

@@ -47,7 +47,6 @@ import net.runelite.api.KeyFocusListener;
import net.runelite.api.MainBufferProvider; import net.runelite.api.MainBufferProvider;
import net.runelite.api.MenuAction; import net.runelite.api.MenuAction;
import net.runelite.api.MessageNode; import net.runelite.api.MessageNode;
import net.runelite.api.PacketBuffer;
import net.runelite.api.Projectile; import net.runelite.api.Projectile;
import net.runelite.api.Region; import net.runelite.api.Region;
import net.runelite.api.RenderOverview; import net.runelite.api.RenderOverview;
@@ -441,7 +440,7 @@ public class Hooks
eventBus.post(setMessage); eventBus.post(setMessage);
} }
public static void onNpcUpdate(boolean var0, PacketBuffer var1) public static void updateNpcs()
{ {
// The NPC update event seem to run every server tick, // The NPC update event seem to run every server tick,
// but having the game tick event after all packets // but having the game tick event after all packets

View File

@@ -104,6 +104,11 @@ public class Hooks
throw new RuntimeException(); throw new RuntimeException();
} }
public static void updateNpcs()
{
throw new RuntimeException();
}
public static boolean menuActionHook(int actionParam, int widgetId, int menuAction, int id, String menuOption, String menuTarget, int var6, int var7) public static boolean menuActionHook(int actionParam, int widgetId, int menuAction, int id, String menuOption, String menuTarget, int var6, int var7)
{ {
throw new RuntimeException(); throw new RuntimeException();

View File

@@ -49,6 +49,7 @@ import static net.runelite.api.MenuAction.PLAYER_THIRD_OPTION;
import net.runelite.api.MenuEntry; import net.runelite.api.MenuEntry;
import net.runelite.api.NPC; import net.runelite.api.NPC;
import net.runelite.api.Node; import net.runelite.api.Node;
import net.runelite.api.PacketBuffer;
import static net.runelite.api.Perspective.LOCAL_TILE_SIZE; import static net.runelite.api.Perspective.LOCAL_TILE_SIZE;
import net.runelite.api.Player; import net.runelite.api.Player;
import net.runelite.api.Point; import net.runelite.api.Point;
@@ -1026,4 +1027,11 @@ public abstract class RSClientMixin implements RSClient
event.setMenuEntries(getMenuEntries()); event.setMenuEntries(getMenuEntries());
eventBus.post(event); eventBus.post(event);
} }
@Inject
@MethodHook("updateNpcs")
public static void updateNpcs(boolean var0, PacketBuffer var1)
{
Hooks.updateNpcs();
}
} }