From efd365daeb682936c767023dfd342c7f2726b749 Mon Sep 17 00:00:00 2001 From: "Lukas Rieger (Blue)" Date: Sun, 21 Aug 2022 00:26:34 +0200 Subject: [PATCH] Fix issue with checking render-playerlimit --- .../bluecolored/bluemap/common/plugin/Plugin.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/Plugin.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/Plugin.java index 3c1416b9..d5dac0f0 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/Plugin.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/Plugin.java @@ -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() {