|
@@ -3,14 +3,12 @@ package com.gmail.nossr50.config;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
-import com.gmail.nossr50.mcMMO;
|
|
|
|
-
|
|
|
|
public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|
public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|
private static AdvancedConfig instance;
|
|
private static AdvancedConfig instance;
|
|
|
|
|
|
private AdvancedConfig() {
|
|
private AdvancedConfig() {
|
|
super("advanced.yml");
|
|
super("advanced.yml");
|
|
- loadKeys();
|
|
|
|
|
|
+ validate();
|
|
}
|
|
}
|
|
|
|
|
|
public static AdvancedConfig getInstance() {
|
|
public static AdvancedConfig getInstance() {
|
|
@@ -22,7 +20,7 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- protected void loadKeys() {
|
|
|
|
|
|
+ protected boolean validateKeys() {
|
|
// Validate all the settings!
|
|
// Validate all the settings!
|
|
List<String> reason = new ArrayList<String>();
|
|
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!");
|
|
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 */
|
|
/* GENERAL */
|
|
public int getAbilityLength() { return config.getInt("Skills.General.Ability_IncreaseLevel", 50); }
|
|
public int getAbilityLength() { return config.getInt("Skills.General.Ability_IncreaseLevel", 50); }
|
|
public int getEnchantBuff() { return config.getInt("Skills.General.Ability_EnchantBuff", 5); }
|
|
public int getEnchantBuff() { return config.getInt("Skills.General.Ability_EnchantBuff", 5); }
|