From 3b5ccc469078ff07ca625fb96888ed66480f905d Mon Sep 17 00:00:00 2001 From: Brianna O'Keefe Date: Thu, 13 Sep 2018 13:01:52 -0400 Subject: [PATCH] Optional support --- .../com/songoda/epicanchors/handlers/AnchorHandler.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/EpicAnchors-Plugin/src/main/java/com/songoda/epicanchors/handlers/AnchorHandler.java b/EpicAnchors-Plugin/src/main/java/com/songoda/epicanchors/handlers/AnchorHandler.java index 8e6e9bc..b60fa40 100644 --- a/EpicAnchors-Plugin/src/main/java/com/songoda/epicanchors/handlers/AnchorHandler.java +++ b/EpicAnchors-Plugin/src/main/java/com/songoda/epicanchors/handlers/AnchorHandler.java @@ -17,8 +17,13 @@ public class AnchorHandler { private EpicAnchorsPlugin instance; private Map delays = new HashMap<>(); + private boolean epicSpawners; + public AnchorHandler(EpicAnchorsPlugin instance) { this.instance = instance; + + epicSpawners = instance.getServer().getPluginManager().getPlugin("EpicSpawners") != null; + Bukkit.getScheduler().scheduleSyncRepeatingTask(instance, this::doAnchorCheck, 0, 20); //ToDo: way to fast. Bukkit.getScheduler().scheduleSyncRepeatingTask(instance, this::doParticle, 0, 2); //ToDo: way to fast. } @@ -38,8 +43,6 @@ public class AnchorHandler { } } - private boolean epicSpawners = instance.getServer().getPluginManager().getPlugin("EpicSpawners") != null; - private void doAnchorCheck() { for (Anchor anchor : instance.getAnchorManager().getAnchors().values()) {