Optional support

This commit is contained in:
Brianna O'Keefe 2018-09-13 13:01:52 -04:00
parent 788604c656
commit 3b5ccc4690

View File

@ -17,8 +17,13 @@ public class AnchorHandler {
private EpicAnchorsPlugin instance;
private Map<Location, Integer> 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()) {