Don't try to register listeners when mcMMO was disabled

This commit is contained in:
TfT_02 2013-08-10 19:33:21 +02:00
parent ead1398132
commit 4ff6b5fbc7
3 changed files with 9 additions and 5 deletions

View File

@ -777,6 +777,7 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
} else {
mcMMO.p.getLogger().warning("Errors were found in " + fileName + "! mcMMO was disabled!");
mcMMO.p.getServer().getPluginManager().disablePlugin(mcMMO.p);
mcMMO.p.noErrorsInConfigFiles = false;
}
}

View File

@ -203,6 +203,7 @@ public class Config extends AutoUpdateConfigLoader {
} else {
mcMMO.p.getLogger().warning("Errors were found in " + fileName + "! mcMMO was disabled!");
mcMMO.p.getServer().getPluginManager().disablePlugin(mcMMO.p);
mcMMO.p.noErrorsInConfigFiles = false;
}
}

View File

@ -78,6 +78,9 @@ public class mcMMO extends JavaPlugin {
private static boolean spoutEnabled;
private static boolean combatTagEnabled;
// Config Validation Check
public boolean noErrorsInConfigFiles = true;
// XP Event Check
private boolean xpEventEnabled;
@ -109,6 +112,10 @@ public class mcMMO extends JavaPlugin {
setupSpout();
loadConfigFiles();
if (!noErrorsInConfigFiles) {
return;
}
combatTagEnabled = getServer().getPluginManager().getPlugin("CombatTag") != null;
databaseManager = DatabaseManagerFactory.getDatabaseManager();
@ -307,11 +314,6 @@ public class mcMMO extends JavaPlugin {
repairables.addAll(rManager.getLoadedRepairables());
repairableManager = RepairableManagerFactory.getRepairManager(repairables.size());
repairableManager.registerRepairables(repairables);
// Check if Repair Anvil and Salvage Anvil have different itemID's
if (Config.getInstance().getSalvageAnvilId() == Config.getInstance().getRepairAnvilId()) {
getLogger().warning("Can't use the same itemID for Repair/Salvage Anvils!");
}
}
private void setupSpout() {