Skip to content

Commit efd365d

Browse files
committed
Fix issue with checking render-playerlimit
1 parent 4c9b45e commit efd365d

File tree

1 file changed

+12
-2
lines changed
  • BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin

1 file changed

+12
-2
lines changed

BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/Plugin.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,12 +478,22 @@ public boolean flushWorldUpdates(World world) throws IOException {
478478

479479
@Override
480480
public void onPlayerJoin(UUID playerUuid) {
481-
checkPausedByPlayerCount();
481+
checkPausedByPlayerCountSoon();
482482
}
483483

484484
@Override
485485
public void onPlayerLeave(UUID playerUuid) {
486-
checkPausedByPlayerCount();
486+
checkPausedByPlayerCountSoon();
487+
}
488+
489+
private void checkPausedByPlayerCountSoon() {
490+
// check is done a second later to make sure the player has actually joined/left and is no longer on the list
491+
daemonTimer.schedule(new TimerTask() {
492+
@Override
493+
public void run() {
494+
checkPausedByPlayerCount();
495+
}
496+
}, 1000);
487497
}
488498

489499
public boolean checkPausedByPlayerCount() {

0 commit comments

Comments
 (0)