mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 00:38:21 +00:00
Add a tick counter that updates on every World pulse
This commit is contained in:
@@ -66,6 +66,11 @@ public final class World {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* A counter for the number of ticks ran.
|
||||
*/
|
||||
private long tickCounter = 0;
|
||||
|
||||
/**
|
||||
* The logger for this class.
|
||||
*/
|
||||
@@ -208,6 +213,15 @@ public final class World {
|
||||
return releaseNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current value of the {@link #tickCounter} (the number of ticks since the game started).
|
||||
*
|
||||
* @return The current value of the tick counter;
|
||||
*/
|
||||
public long tick() {
|
||||
return tickCounter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialises the world by loading definitions from the specified file
|
||||
* system.
|
||||
@@ -277,6 +291,7 @@ public final class World {
|
||||
unregisterNpcs();
|
||||
registerNpcs();
|
||||
scheduler.pulse();
|
||||
tickCounter++;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user