1
0
mirror of https://github.com/mcMMO-Dev/mcMMO.git synced 2026-02-20 02:33:15 +01:00

Validate in a seperate function.

This commit is contained in:
GJ
2013-08-20 15:51:12 -04:00
parent 045d74fb9d
commit 07dd460d78
5 changed files with 29 additions and 32 deletions

View File

@@ -92,6 +92,10 @@ public abstract class ConfigLoader {
}
}
protected boolean validateKeys() {
return true;
}
protected boolean noErrorsInConfig(List<String> issues) {
for (String issue : issues) {
plugin.getLogger().warning(issue);
@@ -99,4 +103,15 @@ public abstract class ConfigLoader {
return issues.isEmpty();
}
protected void validate() {
if (validateKeys()) {
plugin.debug("No errors found in " + fileName + "!");
}
else {
plugin.getLogger().warning("Errors were found in " + fileName + "! mcMMO was disabled!");
plugin.getServer().getPluginManager().disablePlugin(plugin);
plugin.noErrorsInConfigFiles = false;
}
}
}