From 8a918a649b9dc96a6c51c1c60999b414b084deb6 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 1 May 2021 11:08:14 +0200 Subject: [PATCH] Fix AFKStopperListener --- .../bausystem/features/world/AFKStopperListener.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/world/AFKStopperListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/world/AFKStopperListener.java index a1002070..07030ce1 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/world/AFKStopperListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/world/AFKStopperListener.java @@ -34,15 +34,15 @@ public class AFKStopperListener implements Listener { private static final String afkWarning = BauSystem.PREFIX + ColorConfig.DISABLE + "Dieser Server wird bei weiterer Inaktivität in einer Minute gestoppt"; - private int minutesAfk; + private int minutesAfk = 0; public AFKStopperListener() { - minutesAfk = 0; Bukkit.getScheduler().runTaskTimer(BauSystem.getInstance(), () -> { switch (minutesAfk) { case 5: - for (Player p : Bukkit.getOnlinePlayers()) + for (Player p : Bukkit.getOnlinePlayers()) { p.kickPlayer(ColorConfig.DISABLE + "Auf diesem Server ist seit 5 Minuten nichts passiert."); + } break; case 4: Bukkit.broadcastMessage(afkWarning);