Disable announcer when interval <= 0

This commit is contained in:
Goh Wei Wen 2020-06-14 22:01:33 +08:00
parent 3a810bda54
commit 0cd57d17f2

View File

@ -46,7 +46,7 @@ public class AnnouncerCache {
for (File file : folder.listFiles()) {
addAnnouncer(new Announcer(plugin, file));
}
if (!announcers.isEmpty()) {
if (!announcers.isEmpty() && plugin.getMainConfig().getAnnouncmentInterval() > 0) {
new AnnouncerTask(plugin).runTaskTimer(plugin, plugin.getMainConfig().getAnnouncmentInterval(), plugin.getMainConfig().getAnnouncmentInterval());
}
Bukkit.getPluginManager().registerEvents(new AnnouncerListener(plugin), plugin);