No players, no announcements

Not broadcasting announcements if nobody is online (mainly because of Discord)
This commit is contained in:
Norbi Peti 2018-12-24 00:14:38 +01:00
parent fd72e2de91
commit cf8af73ed0
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56

View file

@ -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++;