mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Move update ticking state
This commit is contained in:
parent
f83e2fb093
commit
4fd9cbe249
1 changed files with 6 additions and 6 deletions
|
|
@ -1076,12 +1076,6 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
|||
downstream.connect(false, loginEvent.transferring());
|
||||
}
|
||||
|
||||
public void updateTickingState(float tickRate, boolean frozen) {
|
||||
tickThread.cancel(true);
|
||||
this.tickingFrozen = frozen;
|
||||
tickThread = eventLoop.scheduleAtFixedRate(this::tick, Math.round(1000 / tickRate), Math.round(1000 / tickRate), TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
public void disconnect(String reason) {
|
||||
if (!closed) {
|
||||
loggedIn = false;
|
||||
|
|
@ -1170,6 +1164,12 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
|||
}, duration, timeUnit);
|
||||
}
|
||||
|
||||
public void updateTickingState(float tickRate, boolean frozen) {
|
||||
tickThread.cancel(true);
|
||||
this.tickingFrozen = frozen;
|
||||
tickThread = eventLoop.scheduleAtFixedRate(this::tick, Math.round(1000 / tickRate), Math.round(1000 / tickRate), TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called every Minecraft tick - 1000/tickRate milliseconds.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue