From c3610be4e112c58b25737c6ad8d25f32a364fb77 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 2 Apr 2021 16:20:34 +0200 Subject: [PATCH] Add shutdown of bau after one minute no player --- BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java index 3f889cf..85d6aed 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java @@ -165,6 +165,9 @@ public class BauSystem extends JavaPlugin implements Listener { Player p = e.getPlayer(); SWScoreboard.removeScoreboard(p); if (Bukkit.getOnlinePlayers().isEmpty() || (Bukkit.getOnlinePlayers().size() == 1 && Bukkit.getOnlinePlayers().contains(p))) { + if (autoShutdown != null) { + autoShutdown.cancel(); + } autoShutdown = Bukkit.getScheduler().runTaskLater(this, Bukkit::shutdown, 1200); } }