Fix issue with checking render-playerlimit

This commit is contained in:
Lukas Rieger (Blue) 2022-08-21 00:26:34 +02:00
parent 4c9b45e6eb
commit efd365daeb
No known key found for this signature in database
GPG Key ID: 2D09EC5ED2687FF2

View File

@ -478,12 +478,22 @@ public boolean flushWorldUpdates(World world) throws IOException {
@Override
public void onPlayerJoin(UUID playerUuid) {
checkPausedByPlayerCount();
checkPausedByPlayerCountSoon();
}
@Override
public void onPlayerLeave(UUID playerUuid) {
checkPausedByPlayerCount();
checkPausedByPlayerCountSoon();
}
private void checkPausedByPlayerCountSoon() {
// check is done a second later to make sure the player has actually joined/left and is no longer on the list
daemonTimer.schedule(new TimerTask() {
@Override
public void run() {
checkPausedByPlayerCount();
}
}, 1000);
}
public boolean checkPausedByPlayerCount() {