From cf8af73ed05f0ea71d34ae3c609411c343663ce6 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Mon, 24 Dec 2018 00:14:38 +0100 Subject: [PATCH] No players, no announcements Not broadcasting announcements if nobody is online (mainly because of Discord) --- src/main/java/buttondevteam/chat/AnnouncerThread.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/buttondevteam/chat/AnnouncerThread.java b/src/main/java/buttondevteam/chat/AnnouncerThread.java index b1b11da..60d40e7 100644 --- a/src/main/java/buttondevteam/chat/AnnouncerThread.java +++ b/src/main/java/buttondevteam/chat/AnnouncerThread.java @@ -13,6 +13,7 @@ public class AnnouncerThread implements Runnable { } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } + if (Bukkit.getOnlinePlayers().size() == 0) continue; //Don't post to Discord if nobody is on if (PluginMain.AnnounceMessages.size() > AnnounceMessageIndex) { Bukkit.broadcastMessage(PluginMain.AnnounceMessages.get(AnnounceMessageIndex)); AnnounceMessageIndex++;