mirror of
https://github.com/Minestom/Minestom.git
synced 2025-02-21 23:01:32 +01:00
chore: field reordering
(cherry picked from commit 2b0737615f8171a0172ba902786da0542f962d78)
This commit is contained in:
parent
4e33a5e6d8
commit
a032bc32a7
@ -10,6 +10,9 @@ import java.util.concurrent.locks.LockSupport;
|
|||||||
public final class TickSchedulerThread extends MinestomThread {
|
public final class TickSchedulerThread extends MinestomThread {
|
||||||
private final ServerProcess serverProcess;
|
private final ServerProcess serverProcess;
|
||||||
|
|
||||||
|
private final long startTickNs = System.nanoTime();
|
||||||
|
private long tick = 1;
|
||||||
|
|
||||||
public TickSchedulerThread(ServerProcess serverProcess) {
|
public TickSchedulerThread(ServerProcess serverProcess) {
|
||||||
super(MinecraftServer.THREAD_NAME_TICK_SCHEDULER);
|
super(MinecraftServer.THREAD_NAME_TICK_SCHEDULER);
|
||||||
this.serverProcess = serverProcess;
|
this.serverProcess = serverProcess;
|
||||||
@ -29,10 +32,6 @@ public final class TickSchedulerThread extends MinestomThread {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private final long startTickNs = System.nanoTime();
|
|
||||||
private long tick = 1;
|
|
||||||
|
|
||||||
private void fixTickRate(long tickNs) {
|
private void fixTickRate(long tickNs) {
|
||||||
long nextTickNs = startTickNs + (tickNs * tick);
|
long nextTickNs = startTickNs + (tickNs * tick);
|
||||||
if (System.nanoTime() < nextTickNs) {
|
if (System.nanoTime() < nextTickNs) {
|
||||||
|
Loading…
Reference in New Issue
Block a user