runelite-client: add tick counter

This commit is contained in:
Adam
2018-05-07 09:31:16 -04:00
parent 5fde24cecb
commit ccef1dddd0
3 changed files with 22 additions and 0 deletions

View File

@@ -447,4 +447,8 @@ public interface Client extends GameEngine
@VisibleForDevtools
void setChangedSkillsCount(int i);
int getTickCount();
void setTickCount(int tickCount);
}

View File

@@ -119,6 +119,9 @@ public class Hooks
_deferredEventBus.replay();
eventBus.post(tick);
int tick = client.getTickCount();
client.setTickCount(tick + 1);
}
clientThread.invoke();

View File

@@ -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;
}
}