runelite-client: add tick counter
This commit is contained in:
@@ -447,4 +447,8 @@ public interface Client extends GameEngine
|
||||
|
||||
@VisibleForDevtools
|
||||
void setChangedSkillsCount(int i);
|
||||
|
||||
int getTickCount();
|
||||
|
||||
void setTickCount(int tickCount);
|
||||
}
|
||||
|
||||
@@ -119,6 +119,9 @@ public class Hooks
|
||||
_deferredEventBus.replay();
|
||||
|
||||
eventBus.post(tick);
|
||||
|
||||
int tick = client.getTickCount();
|
||||
client.setTickCount(tick + 1);
|
||||
}
|
||||
|
||||
clientThread.invoke();
|
||||
|
||||
@@ -105,6 +105,9 @@ public abstract class RSClientMixin implements RSClient
|
||||
@Shadow("clientInstance")
|
||||
private static RSClient client;
|
||||
|
||||
@Inject
|
||||
private static int tickCount;
|
||||
|
||||
@Inject
|
||||
private static boolean interpolatePlayerAnimations;
|
||||
|
||||
@@ -883,4 +886,16 @@ public abstract class RSClientMixin implements RSClient
|
||||
{
|
||||
eventBus.post(new UsernameChanged());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTickCount()
|
||||
{
|
||||
return tickCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTickCount(int tick)
|
||||
{
|
||||
tickCount = tick;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user