From e6e90954a92c77ff10f7408018317acfb0165964 Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Fri, 17 Jan 2014 15:51:28 +0100 Subject: [PATCH] Changed config validation for UnlockLevels, they can now also be 0 Closes #1790 --- Changelog.txt | 1 + .../gmail/nossr50/config/AdvancedConfig.java | 44 +++++++++---------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 7572ca8f1..9cde54dc2 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -36,6 +36,7 @@ Version 1.4.08-dev ! Changed AxesCritical to CriticalHit in config file ! Changed several secondary ability permissions(deprecated versions still exist) ! Changed /ptp config setting, Commands.ptp.Confirm_Required is now Commands.ptp.Accept.Required + ! Changed config validation for UnlockLevels, they can now also be 0 - Removed /stats alias for /mcstats Version 1.4.07 diff --git a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java index a251c5c59..d6585e608 100644 --- a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java +++ b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java @@ -239,12 +239,12 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { reason.add("Skills.Fishing.FishermansDiet.RankChange should be at least 1!"); } - if (getIceFishingUnlockLevel() < 1) { - reason.add("Skills.Fishing.IceFishing.UnlockLevel should be at least 1!"); + if (getIceFishingUnlockLevel() < 0) { + reason.add("Skills.Fishing.IceFishing.UnlockLevel should be at least 0!"); } - if (getMasterAnglerUnlockLevel() < 1) { - reason.add("Skills.Fishing.MasterAngler.UnlockLevel should be at least 1!"); + if (getMasterAnglerUnlockLevel() < 0) { + reason.add("Skills.Fishing.MasterAngler.UnlockLevel should be at least 0!"); } if (getMasterAnglerBoatModifier() < 1) { @@ -378,8 +378,8 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { reason.add("Skills.Repair.SuperRepair.MaxBonusLevel should be at least 1!"); } - if (getSalvageUnlockLevel() < 1) { - reason.add("Skills.Repair.Salvage.UnlockLevel should be at least 1!"); + if (getSalvageUnlockLevel() < 0) { + reason.add("Skills.Repair.Salvage.UnlockLevel should be at least 0!"); } List arcaneForgingTierList = Arrays.asList(ArcaneForging.Tier.values()); @@ -431,8 +431,8 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { reason.add("Skills.Smelting.SecondSmelt.ChanceMax should be at least 1!"); } - if (getFluxMiningUnlockLevel() < 1) { - reason.add("Skills.Smelting.FluxMining.UnlockLevel should be at least 1!"); + if (getFluxMiningUnlockLevel() < 0) { + reason.add("Skills.Smelting.FluxMining.UnlockLevel should be at least 0!"); } if (getFluxMiningChance() < 1) { @@ -522,40 +522,40 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { reason.add("Skills.Taming.Gore.Modifier should be at least 1!"); } - if (getFastFoodUnlock() < 1) { - reason.add("Skills.Taming.FastFood.UnlockLevel should be at least 1!"); + if (getFastFoodUnlock() < 0) { + reason.add("Skills.Taming.FastFood.UnlockLevel should be at least 0!"); } if (getFastFoodChance() < 1) { reason.add("Skills.Taming.FastFood.Chance should be at least 1!"); } - if (getEnviromentallyAwareUnlock() < 1) { - reason.add("Skills.Taming.EnvironmentallyAware.UnlockLevel should be at least 1!"); + if (getEnviromentallyAwareUnlock() < 0) { + reason.add("Skills.Taming.EnvironmentallyAware.UnlockLevel should be at least 0!"); } - if (getThickFurUnlock() < 1) { - reason.add("Skills.Taming.ThickFur.UnlockLevel should be at least 1!"); + if (getThickFurUnlock() < 0) { + reason.add("Skills.Taming.ThickFur.UnlockLevel should be at least 0!"); } if (getThickFurModifier() < 1) { reason.add("Skills.Taming.ThickFur.Modifier should be at least 1!"); } - if (getHolyHoundUnlock() < 1) { - reason.add("Skills.Taming.HolyHound.UnlockLevel should be at least 1!"); + if (getHolyHoundUnlock() < 0) { + reason.add("Skills.Taming.HolyHound.UnlockLevel should be at least 0!"); } - if (getShockProofUnlock() < 1) { - reason.add("Skills.Taming.ShockProof.UnlockLevel should be at least 1!"); + if (getShockProofUnlock() < 0) { + reason.add("Skills.Taming.ShockProof.UnlockLevel should be at least 0!"); } if (getShockProofModifier() < 1) { reason.add("Skills.Taming.ShockProof.Modifier should be at least 1!"); } - if (getSharpenedClawsUnlock() < 1) { - reason.add("Skills.Taming.SharpenedClaws.UnlockLevel should be at least 1!"); + if (getSharpenedClawsUnlock() < 0) { + reason.add("Skills.Taming.SharpenedClaws.UnlockLevel should be at least 0!"); } if (getSharpenedClawsBonus() < 1) { @@ -608,8 +608,8 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { } /* WOODCUTTING */ - if (getLeafBlowUnlockLevel() < 1) { - reason.add("Skills.Woodcutting.LeafBlower.UnlockLevel should be at least 1!"); + if (getLeafBlowUnlockLevel() < 0) { + reason.add("Skills.Woodcutting.LeafBlower.UnlockLevel should be at least 0!"); } if (getMaxChance(SecondaryAbility.WOODCUTTING_DOUBLE_DROPS) < 1) {