Null checked hoppers on load.

Hoppers are now delayed on load as to account for slow loading plugins and not to create confliction.
This commit is contained in:
Brianna O'Keefe 2018-07-13 09:49:31 -04:00
parent 41509821c1
commit 1a944bc8db

View File

@ -85,11 +85,14 @@ public final class EpicHoppers extends JavaPlugin implements Listener {
hopperManager = new HopperManager();
/*
* Register furnaces into FurnaceManger from configuration
* Register hoppers into HopperManger from configuration
*/
Bukkit.getScheduler().runTaskLater(this, () -> {
if (dataFile.getConfig().contains("data.sync")) {
for (String locationStr : dataFile.getConfig().getConfigurationSection("data.sync").getKeys(false)) {
Location location = Arconix.pl().getApi().serialize().unserializeLocation(locationStr);
if (location == null || location.getBlock() == null) return;
int level = dataFile.getConfig().getInt("data.sync." + locationStr + ".level");
String blockLoc = dataFile.getConfig().getString("data.sync." + locationStr + ".block");
@ -120,6 +123,8 @@ public final class EpicHoppers extends JavaPlugin implements Listener {
}
}
}, 10);
references = new References();
hooks = new HookHandler();