mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
Don't try to register listeners when mcMMO was disabled
This commit is contained in:
parent
ead1398132
commit
4ff6b5fbc7
@ -777,6 +777,7 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
} else {
|
} else {
|
||||||
mcMMO.p.getLogger().warning("Errors were found in " + fileName + "! mcMMO was disabled!");
|
mcMMO.p.getLogger().warning("Errors were found in " + fileName + "! mcMMO was disabled!");
|
||||||
mcMMO.p.getServer().getPluginManager().disablePlugin(mcMMO.p);
|
mcMMO.p.getServer().getPluginManager().disablePlugin(mcMMO.p);
|
||||||
|
mcMMO.p.noErrorsInConfigFiles = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,6 +203,7 @@ public class Config extends AutoUpdateConfigLoader {
|
|||||||
} else {
|
} else {
|
||||||
mcMMO.p.getLogger().warning("Errors were found in " + fileName + "! mcMMO was disabled!");
|
mcMMO.p.getLogger().warning("Errors were found in " + fileName + "! mcMMO was disabled!");
|
||||||
mcMMO.p.getServer().getPluginManager().disablePlugin(mcMMO.p);
|
mcMMO.p.getServer().getPluginManager().disablePlugin(mcMMO.p);
|
||||||
|
mcMMO.p.noErrorsInConfigFiles = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,6 +78,9 @@ public class mcMMO extends JavaPlugin {
|
|||||||
private static boolean spoutEnabled;
|
private static boolean spoutEnabled;
|
||||||
private static boolean combatTagEnabled;
|
private static boolean combatTagEnabled;
|
||||||
|
|
||||||
|
// Config Validation Check
|
||||||
|
public boolean noErrorsInConfigFiles = true;
|
||||||
|
|
||||||
// XP Event Check
|
// XP Event Check
|
||||||
private boolean xpEventEnabled;
|
private boolean xpEventEnabled;
|
||||||
|
|
||||||
@ -109,6 +112,10 @@ public class mcMMO extends JavaPlugin {
|
|||||||
setupSpout();
|
setupSpout();
|
||||||
loadConfigFiles();
|
loadConfigFiles();
|
||||||
|
|
||||||
|
if (!noErrorsInConfigFiles) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
combatTagEnabled = getServer().getPluginManager().getPlugin("CombatTag") != null;
|
combatTagEnabled = getServer().getPluginManager().getPlugin("CombatTag") != null;
|
||||||
|
|
||||||
databaseManager = DatabaseManagerFactory.getDatabaseManager();
|
databaseManager = DatabaseManagerFactory.getDatabaseManager();
|
||||||
@ -307,11 +314,6 @@ public class mcMMO extends JavaPlugin {
|
|||||||
repairables.addAll(rManager.getLoadedRepairables());
|
repairables.addAll(rManager.getLoadedRepairables());
|
||||||
repairableManager = RepairableManagerFactory.getRepairManager(repairables.size());
|
repairableManager = RepairableManagerFactory.getRepairManager(repairables.size());
|
||||||
repairableManager.registerRepairables(repairables);
|
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() {
|
private void setupSpout() {
|
||||||
|
Loading…
Reference in New Issue
Block a user