mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-30 20:54:44 +02:00
Validate in a seperate function.
This commit is contained in:
@ -3,14 +3,12 @@ package com.gmail.nossr50.config;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
|
||||
public class AdvancedConfig extends AutoUpdateConfigLoader {
|
||||
private static AdvancedConfig instance;
|
||||
|
||||
private AdvancedConfig() {
|
||||
super("advanced.yml");
|
||||
loadKeys();
|
||||
validate();
|
||||
}
|
||||
|
||||
public static AdvancedConfig getInstance() {
|
||||
@ -22,7 +20,7 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadKeys() {
|
||||
protected boolean validateKeys() {
|
||||
// Validate all the settings!
|
||||
List<String> reason = new ArrayList<String>();
|
||||
|
||||
@ -778,17 +776,12 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
||||
reason.add("Kraken.Attack_Damage should be at least 1!");
|
||||
}
|
||||
|
||||
// Check if there were any errors
|
||||
if (noErrorsInConfig(reason)) {
|
||||
mcMMO.p.debug("No errors found in " + fileName + "!");
|
||||
}
|
||||
else {
|
||||
mcMMO.p.getLogger().warning("Errors were found in " + fileName + "! mcMMO was disabled!");
|
||||
mcMMO.p.getServer().getPluginManager().disablePlugin(mcMMO.p);
|
||||
mcMMO.p.noErrorsInConfigFiles = false;
|
||||
}
|
||||
return noErrorsInConfig(reason);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadKeys() {}
|
||||
|
||||
/* GENERAL */
|
||||
public int getAbilityLength() { return config.getInt("Skills.General.Ability_IncreaseLevel", 50); }
|
||||
public int getEnchantBuff() { return config.getInt("Skills.General.Ability_EnchantBuff", 5); }
|
||||
|
Reference in New Issue
Block a user