mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Move the noErrorsInConfig check to Misc
This commit is contained in:
parent
dcc18049a1
commit
6330c4a69e
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
|
||||||
public class AdvancedConfig extends AutoUpdateConfigLoader {
|
public class AdvancedConfig extends AutoUpdateConfigLoader {
|
||||||
private static AdvancedConfig instance;
|
private static AdvancedConfig instance;
|
||||||
@ -771,7 +772,7 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if there were any errors
|
// Check if there were any errors
|
||||||
if (noErrorsInConfig(reason)) {
|
if (Misc.noErrorsInConfig(reason)) {
|
||||||
mcMMO.p.debug("No errors found in " + fileName + "!");
|
mcMMO.p.debug("No errors found in " + fileName + "!");
|
||||||
} 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!");
|
||||||
@ -1050,12 +1051,4 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
public String getPlayerEscapeMessage() { return config.getString("Kraken.Defeated_Message.Escape", "You have escaped from the kraken!"); }
|
public String getPlayerEscapeMessage() { return config.getString("Kraken.Defeated_Message.Escape", "You have escaped from the kraken!"); }
|
||||||
public int getKrakenAttackInterval() { return config.getInt("Kraken.Attack_Interval_Seconds", 1); }
|
public int getKrakenAttackInterval() { return config.getInt("Kraken.Attack_Interval_Seconds", 1); }
|
||||||
public int getKrakenAttackDamage() { return config.getInt("Kraken.Attack_Damage", 1); }
|
public int getKrakenAttackDamage() { return config.getInt("Kraken.Attack_Damage", 1); }
|
||||||
|
|
||||||
private boolean noErrorsInConfig(List<String> issues) {//TODO move this to misc
|
|
||||||
for (String issue : issues) {
|
|
||||||
plugin.getLogger().warning(issue);
|
|
||||||
}
|
|
||||||
|
|
||||||
return issues.isEmpty();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ import com.gmail.nossr50.mcMMO;
|
|||||||
import com.gmail.nossr50.datatypes.MobHealthbarType;
|
import com.gmail.nossr50.datatypes.MobHealthbarType;
|
||||||
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
import com.gmail.nossr50.util.StringUtils;
|
import com.gmail.nossr50.util.StringUtils;
|
||||||
|
|
||||||
public class Config extends AutoUpdateConfigLoader {
|
public class Config extends AutoUpdateConfigLoader {
|
||||||
@ -201,7 +202,7 @@ public class Config extends AutoUpdateConfigLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if there were any errors
|
// Check if there were any errors
|
||||||
if (noErrorsInConfig(reason)) {
|
if (Misc.noErrorsInConfig(reason)) {
|
||||||
mcMMO.p.debug("No errors found in " + fileName + "!");
|
mcMMO.p.debug("No errors found in " + fileName + "!");
|
||||||
} 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!");
|
||||||
@ -489,12 +490,4 @@ public class Config extends AutoUpdateConfigLoader {
|
|||||||
public int getFormulaMultiplierCurve() { return config.getInt("Experience.Formula.Curve_Modifier", 20); }
|
public int getFormulaMultiplierCurve() { return config.getInt("Experience.Formula.Curve_Modifier", 20); }
|
||||||
public boolean getCumulativeCurveEnabled() { return config.getBoolean("Experience.Formula.Cumulative_Curve", false); }
|
public boolean getCumulativeCurveEnabled() { return config.getBoolean("Experience.Formula.Cumulative_Curve", false); }
|
||||||
public double getFormulaSkillModifier(SkillType skill) { return config.getDouble("Experience.Formula.Modifier." + StringUtils.getCapitalized(skill.toString())); }
|
public double getFormulaSkillModifier(SkillType skill) { return config.getDouble("Experience.Formula.Modifier." + StringUtils.getCapitalized(skill.toString())); }
|
||||||
|
|
||||||
private boolean noErrorsInConfig(List<String> issues) {
|
|
||||||
for (String issue : issues) {
|
|
||||||
plugin.getLogger().warning(issue);
|
|
||||||
}
|
|
||||||
|
|
||||||
return issues.isEmpty();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -261,6 +261,14 @@ public final class Misc {
|
|||||||
return ((Furnace) furnaceState).getInventory().getResult();
|
return ((Furnace) furnaceState).getInventory().getResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean noErrorsInConfig(List<String> issues) {
|
||||||
|
for (String issue : issues) {
|
||||||
|
mcMMO.p.getLogger().warning(issue);
|
||||||
|
}
|
||||||
|
|
||||||
|
return issues.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
public static Random getRandom() {
|
public static Random getRandom() {
|
||||||
return random;
|
return random;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user