Move validation to proper location

This commit is contained in:
TfT_02 2013-07-24 23:45:31 +02:00
parent ccbffca278
commit 7683dfc436
2 changed files with 14 additions and 11 deletions

View File

@ -116,7 +116,7 @@ public class Config extends AutoUpdateConfigLoader {
} }
if (getPartyShareBonusIncrease() < 0) { if (getPartyShareBonusIncrease() < 0) {
reason.add("Party.Sharing.ExpShare_bonus_increase should be greater than or equal to 0!"); reason.add("Party.Sharing.ExpShare_bonus_increase should be at least 0!");
} }
if (getPartyShareBonusCap() <= 0) { if (getPartyShareBonusCap() <= 0) {
@ -168,28 +168,36 @@ public class Config extends AutoUpdateConfigLoader {
reason.add("Skills.Taming.Call_Of_The_Wild.Fish_Required should be at least 1!"); reason.add("Skills.Taming.Call_Of_The_Wild.Fish_Required should be at least 1!");
} }
if (getTamingCOTWAmount(EntityType.OCELOT) <= 0) {
reason.add("Skills.Taming.Call_Of_The_Wild.Ocelot_Amount should be greater than 0!");
}
if (getTamingCOTWAmount(EntityType.WOLF) <= 0) {
reason.add("Skills.Taming.Call_Of_The_Wild.Wolf_Amount should be greater than 0!");
}
if (getExperienceGainsGlobalMultiplier() <= 0) { if (getExperienceGainsGlobalMultiplier() <= 0) {
reason.add("Experience.Gains.Multiplier.Global should be greater than 0!"); reason.add("Experience.Gains.Multiplier.Global should be greater than 0!");
} }
if (getPlayerVersusPlayerXP() < 0) { if (getPlayerVersusPlayerXP() < 0) {
reason.add("Experience.Gains.Multiplier.PVP should be greater than 0!"); reason.add("Experience.Gains.Multiplier.PVP should be at least 0!");
} }
if (getAnimalsXP() < 0) { if (getAnimalsXP() < 0) {
reason.add("Experience.Gains.Multiplier.Animals should be greater than 0!"); reason.add("Experience.Gains.Multiplier.Animals should be at least 0!");
} }
if (getWitherSkeletonXP() < 0) { if (getWitherSkeletonXP() < 0) {
reason.add("Experience.Gains.Multiplier.Wither_Skeleton should be greater than 0!"); reason.add("Experience.Gains.Multiplier.Wither_Skeleton should be at least 0!");
} }
if (getSpawnedMobXpMultiplier() < 0) { if (getSpawnedMobXpMultiplier() < 0) {
reason.add("Experience.Gains.Mobspawners.Multiplier should be greater than 0!"); reason.add("Experience.Gains.Mobspawners.Multiplier should be at least 0!");
} }
if (getFormulaMultiplierCurve() < 0) { if (getFormulaMultiplierCurve() < 0) {
reason.add("Experience.Formula.Curve_Modifier should be greater than 0!"); reason.add("Experience.Formula.Curve_Modifier should be at least 0!");
} }
// Check if there were any errors // Check if there were any errors

View File

@ -184,11 +184,6 @@ public class TamingManager extends SkillManager {
int amount = Config.getInstance().getTamingCOTWAmount(type); int amount = Config.getInstance().getTamingCOTWAmount(type);
// TODO: Validate in config instead
if (amount <= 0) {
amount = 1;
}
for (int i = 0; i < amount; i++) { for (int i = 0; i < amount; i++) {
LivingEntity entity = (LivingEntity) player.getWorld().spawnEntity(player.getLocation(), type); LivingEntity entity = (LivingEntity) player.getWorld().spawnEntity(player.getLocation(), type);