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()) {