diff --git a/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java index 81176a0e8..39a57e225 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java @@ -7,6 +7,7 @@ import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.datatypes.skills.SkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.skills.fishing.Fishing; +import com.gmail.nossr50.skills.fishing.Fishing.Tier; import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.UserManager; @@ -135,7 +136,7 @@ public class FishingCommand extends SkillCommand { } if (canTreasureHunt) { - player.sendMessage(LocaleLoader.getString("Fishing.Ability.Rank", lootTier)); + player.sendMessage(LocaleLoader.getString("Fishing.Ability.Rank", lootTier, Tier.EIGHT.toNumerical())); } if (canMagicHunt) { @@ -143,7 +144,7 @@ public class FishingCommand extends SkillCommand { } if (canShake) { - int unlockLevel = AdvancedConfig.getInstance().getFishingTierLevelsTier1(); + int unlockLevel = AdvancedConfig.getInstance().getFishingTierLevel(Tier.ONE); if (skillValue < unlockLevel) { player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Fishing.Ability.Locked.0", unlockLevel))); diff --git a/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java index 5c26a58bc..6c379a025 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java @@ -3,6 +3,7 @@ package com.gmail.nossr50.commands.skills; import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.datatypes.skills.SkillType; import com.gmail.nossr50.locale.LocaleLoader; +import com.gmail.nossr50.skills.mining.BlastMining.Tier; import com.gmail.nossr50.skills.mining.Mining; import com.gmail.nossr50.skills.mining.MiningManager; import com.gmail.nossr50.util.Permissions; @@ -114,18 +115,18 @@ public class MiningCommand extends SkillCommand { } if (canBlast) { - int unlockLevel = AdvancedConfig.getInstance().getBlastMiningRank1(); + int unlockLevel = AdvancedConfig.getInstance().getBlastMiningRankLevel(Tier.ONE); if (skillValue < unlockLevel) { player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Mining.Ability.Locked.0", unlockLevel))); } else { - player.sendMessage(LocaleLoader.getString("Mining.Blast.Rank", blastMiningRank, LocaleLoader.getString("Mining.Blast.Effect", oreBonus, debrisReduction, bonusTNTDrops))); + player.sendMessage(LocaleLoader.getString("Mining.Blast.Rank", blastMiningRank, Tier.EIGHT.toNumerical(), LocaleLoader.getString("Mining.Blast.Effect", oreBonus, debrisReduction, bonusTNTDrops))); } } if (canBiggerBombs) { - int unlockLevel = AdvancedConfig.getInstance().getBlastMiningRank2(); + int unlockLevel = AdvancedConfig.getInstance().getBlastMiningRankLevel(Tier.TWO); if (skillValue < unlockLevel) { player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Mining.Ability.Locked.1", unlockLevel))); @@ -136,7 +137,7 @@ public class MiningCommand extends SkillCommand { } if (canDemoExpert) { - int unlockLevel = AdvancedConfig.getInstance().getBlastMiningRank4(); + int unlockLevel = AdvancedConfig.getInstance().getBlastMiningRankLevel(Tier.FOUR); if (skillValue < unlockLevel) { player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Mining.Ability.Locked.2", unlockLevel))); diff --git a/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java index 963820ddb..5faae3b3f 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java @@ -6,6 +6,7 @@ import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.datatypes.skills.SkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.skills.repair.ArcaneForging; +import com.gmail.nossr50.skills.repair.ArcaneForging.Tier; import com.gmail.nossr50.skills.repair.Repair; import com.gmail.nossr50.skills.repair.RepairManager; import com.gmail.nossr50.skills.repair.repairables.Repairable; @@ -145,7 +146,7 @@ public class RepairCommand extends SkillCommand { if (canArcaneForge) { RepairManager repairManager = mcMMOPlayer.getRepairManager(); - player.sendMessage(LocaleLoader.getString("Repair.Arcane.Rank", repairManager.getArcaneForgingRank())); + player.sendMessage(LocaleLoader.getString("Repair.Arcane.Rank", repairManager.getArcaneForgingRank(), Tier.EIGHT.toNumerical())); if (ArcaneForging.arcaneForgingEnchantLoss) { player.sendMessage(LocaleLoader.getString("Repair.Arcane.Chance.Success", (arcaneBypass ? 100 : repairManager.getKeepEnchantChance()))); diff --git a/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java index 39b3490c7..855c82999 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java @@ -4,6 +4,7 @@ import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.datatypes.skills.SkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.skills.smelting.Smelting; +import com.gmail.nossr50.skills.smelting.Smelting.Tier; import com.gmail.nossr50.util.Permissions; public class SmeltingCommand extends SkillCommand { @@ -94,7 +95,7 @@ public class SmeltingCommand extends SkillCommand { } if (canVanillaXPBoost) { - int unlockLevel = AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank1Level(); + int unlockLevel = AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRankLevel(Tier.ONE); if (skillValue < unlockLevel) { player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Smelting.Ability.Locked.0", unlockLevel))); diff --git a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java index 74577697c..50af2545c 100644 --- a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java +++ b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java @@ -1,8 +1,14 @@ package com.gmail.nossr50.config; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; +import com.gmail.nossr50.skills.fishing.Fishing; +import com.gmail.nossr50.skills.mining.BlastMining; +import com.gmail.nossr50.skills.repair.ArcaneForging; +import com.gmail.nossr50.skills.smelting.Smelting; + public class AdvancedConfig extends AutoUpdateConfigLoader { private static AdvancedConfig instance; @@ -173,32 +179,36 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { } /* FISHING */ - if (getFishingTierLevelsTier1() >= getFishingTierLevelsTier2()) { - reason.add("Skills.Fishing.Tier_Levels.Tier1 should be less than Skills.Fishing.Tier_Levels.Tier2!"); - } + List fishingTierList = Arrays.asList(Fishing.Tier.values()); - if (getFishingTierLevelsTier2() >= getFishingTierLevelsTier3()) { - reason.add("Skills.Fishing.Tier_Levels.Tier2 should be less than Skills.Fishing.Tier_Levels.Tier3!"); - } + for (Fishing.Tier tier : fishingTierList) { + if (getFishingTierLevel(tier) < 0) { + reason.add("Skills.Fishing.Tier_Levels.Tier" + tier.toNumerical() + " should be at least 0!"); + } - if (getFishingTierLevelsTier3() >= getFishingTierLevelsTier4()) { - reason.add("Skills.Fishing.Tier_Levels.Tier3 should be less than Skills.Fishing.Tier_Levels.Tier4!"); - } + if (getShakeChance(tier) < 0) { + reason.add("Skills.Fishing.Shake_Chance.Rank_" + tier.toNumerical() + " should be at least 0!"); + } - if (getFishingTierLevelsTier4() >= getFishingTierLevelsTier5()) { - reason.add("Skills.Fishing.Tier_Levels.Tier4 should be less than Skills.Fishing.Tier_Levels.Tier5!"); - } + if (getFishingVanillaXPModifier(tier) < 0) { + reason.add("Skills.Fishing.VanillaXPBoost.Rank_" + tier.toNumerical() + " should be at least 0!"); + } - if (getFishingTierLevelsTier5() >= getFishingTierLevelsTier6()) { - reason.add("Skills.Fishing.Tier_Levels.Tier5 should be less than Skills.Fishing.Tier_Levels.Tier6!"); - } + if (tier != Fishing.Tier.EIGHT) { + Fishing.Tier nextTier = fishingTierList.get(fishingTierList.indexOf(tier) - 1); - if (getFishingTierLevelsTier6() >= getFishingTierLevelsTier7()) { - reason.add("Skills.Fishing.Tier_Levels.Tier6 should be less than Skills.Fishing.Tier_Levels.Tier7!"); - } + if (getFishingTierLevel(tier) >= getFishingTierLevel(nextTier)) { + reason.add("Skills.Fishing.Tier_Levels.Tier" + tier.toNumerical() + " should be less than Skills.Fishing.Tier_Levels.Tier" + nextTier.toNumerical() + "!"); + } - if (getFishingTierLevelsTier7() >= getFishingTierLevelsTier8()) { - reason.add("Skills.Fishing.Tier_Levels.Tier7 should be less than Skills.Fishing.Tier_Levels.Tier8!"); + if (getShakeChance(tier) > getShakeChance(nextTier)) { + reason.add("Skills.Fishing.Shake_Chance.Rank_" + tier.toNumerical() + " should be less than or equal to Skills.Fishing.Shake_Chance.Rank_" + nextTier.toNumerical() + "!"); + } + + if (getFishingVanillaXPModifier(tier) > getFishingVanillaXPModifier(nextTier)) { + reason.add("Skills.Fishing.VanillaXPBoost.Rank_" + tier.toNumerical() + " should be less than or equal to Skills.Fishing.VanillaXPBoost.Rank_" + nextTier.toNumerical() + "!"); + } + } } if (getFishingMagicMultiplier() <= 0) { @@ -213,94 +223,6 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { reason.add("Skills.Fishing.Ice_Fishing_UnlockLevel should be at least 1!"); } - if (getShakeChanceRank1() > getShakeChanceRank2()) { - reason.add("Skills.Fishing.Shake_Chance.Rank_1 should be less or equal to Skills.Fishing.Shake_Chance.Rank_2!"); - } - - if (getShakeChanceRank2() > getShakeChanceRank3()) { - reason.add("Skills.Fishing.Shake_Chance.Rank_2 should be less or equal to Skills.Fishing.Shake_Chance.Rank_3!"); - } - - if (getShakeChanceRank3() > getShakeChanceRank4()) { - reason.add("Skills.Fishing.Shake_Chance.Rank_3 should be less or equal to Skills.Fishing.Shake_Chance.Rank_4!"); - } - - if (getShakeChanceRank4() > getShakeChanceRank5()) { - reason.add("Skills.Fishing.Shake_Chance.Rank_4 should be less or equal to Skills.Fishing.Shake_Chance.Rank_5!"); - } - - if (getShakeChanceRank5() > getShakeChanceRank6()) { - reason.add("Skills.Fishing.Shake_Chance.Rank_5 should be less or equal to Skills.Fishing.Shake_Chance.Rank_6!"); - } - - if (getShakeChanceRank6() > getShakeChanceRank7()) { - reason.add("Skills.Fishing.Shake_Chance.Rank_6 should be less or equal to Skills.Fishing.Shake_Chance.Rank_7!"); - } - - if (getShakeChanceRank7() > getShakeChanceRank8()) { - reason.add("Skills.Fishing.Shake_Chance.Rank_7 should be less or equal to Skills.Fishing.Shake_Chance.Rank_8!"); - } - - if (getFishingVanillaXPModifierRank1() > getFishingVanillaXPModifierRank2()) { - reason.add("Skills.Fishing.VanillaXPBoost.Rank_1 should be less or equal to Skills.Fishing.VanillaXPBoost.Rank_2!"); - } - - if (getFishingVanillaXPModifierRank2() > getFishingVanillaXPModifierRank3()) { - reason.add("Skills.Fishing.VanillaXPBoost.Rank_2 should be less or equal to Skills.Fishing.VanillaXPBoost.Rank_3!"); - } - - if (getFishingVanillaXPModifierRank3() > getFishingVanillaXPModifierRank4()) { - reason.add("Skills.Fishing.VanillaXPBoost.Rank_3 should be less or equal to Skills.Fishing.VanillaXPBoost.Rank_4!"); - } - - if (getFishingVanillaXPModifierRank4() > getFishingVanillaXPModifierRank5()) { - reason.add("Skills.Fishing.VanillaXPBoost.Rank_4 should be less or equal to Skills.Fishing.VanillaXPBoost.Rank_5!"); - } - - if (getFishingVanillaXPModifierRank5() > getFishingVanillaXPModifierRank6()) { - reason.add("Skills.Fishing.VanillaXPBoost.Rank_5 should be less or equal to Skills.Fishing.VanillaXPBoost.Rank_6!"); - } - - if (getFishingVanillaXPModifierRank6() > getFishingVanillaXPModifierRank7()) { - reason.add("Skills.Fishing.VanillaXPBoost.Rank_6 should be less or equal to Skills.Fishing.VanillaXPBoost.Rank_7!"); - } - - if (getFishingVanillaXPModifierRank7() > getFishingVanillaXPModifierRank8()) { - reason.add("Skills.Fishing.VanillaXPBoost.Rank_7 should be less or equal to Skills.Fishing.VanillaXPBoost.Rank_8!"); - } - - if (getFishingVanillaXPModifierRank1() < 0) { - reason.add("Skills.Fishing.VanillaXPBoost.Rank_1 should be at least 0!"); - } - - if (getFishingVanillaXPModifierRank2() < 0) { - reason.add("Skills.Fishing.VanillaXPBoost.Rank_2 should be at least 0!"); - } - - if (getFishingVanillaXPModifierRank3() < 0) { - reason.add("Skills.Fishing.VanillaXPBoost.Rank_3 should be at least 0!"); - } - - if (getFishingVanillaXPModifierRank4() < 0) { - reason.add("Skills.Fishing.VanillaXPBoost.Rank_4 should be at least 0!"); - } - - if (getFishingVanillaXPModifierRank5() < 0) { - reason.add("Skills.Fishing.VanillaXPBoost.Rank_5 should be at least 0!"); - } - - if (getFishingVanillaXPModifierRank6() < 0) { - reason.add("Skills.Fishing.VanillaXPBoost.Rank_6 should be at least 0!"); - } - - if (getFishingVanillaXPModifierRank7() < 0) { - reason.add("Skills.Fishing.VanillaXPBoost.Rank_7 should be at least 0!"); - } - - if (getFishingVanillaXPModifierRank8() < 0) { - reason.add("Skills.Fishing.VanillaXPBoost.Rank_8 should be at least 0!"); - } - /* HERBALISM */ if (getFarmerDietRankChange() < 1) { reason.add("Skills.Herbalism.Farmer_Diet_RankChange should be at least 1!"); @@ -351,172 +273,60 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { reason.add("Skills.Mining.DoubleDrops_MaxBonusLevel should be at least 1!"); } - if (getBlastMiningRank1() > getBlastMiningRank2()) { - reason.add("Skills.Mining.BlastMining_Rank1 should be less or equal to Skills.Mining.BlastMining_Rank2!"); - } + List blastMiningTierList = Arrays.asList(BlastMining.Tier.values()); - if (getBlastMiningRank2() > getBlastMiningRank3()) { - reason.add("Skills.Mining.BlastMining_Rank2 should be less or equal to Skills.Mining.BlastMining_Rank3!"); - } + for (BlastMining.Tier tier : blastMiningTierList) { + if (getBlastMiningRankLevel(tier) < 0) { + reason.add("Skills.Mining.BlastMining_Rank" + tier.toNumerical() + " should be at least 0!"); + } - if (getBlastMiningRank3() > getBlastMiningRank4()) { - reason.add("Skills.Mining.BlastMining_Rank3 should be less or equal to Skills.Mining.BlastMining_Rank4!"); - } + if (getBlastDamageDecrease(tier) < 0) { + reason.add("Skills.Mining.BlastDamageDecrease_Rank" + tier.toNumerical() + " should be at least 0!"); + } - if (getBlastMiningRank4() > getBlastMiningRank5()) { - reason.add("Skills.Mining.BlastMining_Rank4 should be less or equal to Skills.Mining.BlastMining_Rank5!"); - } + if (getOreBonus(tier) < 0) { + reason.add("Skills.Mining.OreBonus_Rank" + tier.toNumerical() + " should be at least 0!"); + } - if (getBlastMiningRank5() > getBlastMiningRank6()) { - reason.add("Skills.Mining.BlastMining_Rank5 should be less or equal to Skills.Mining.BlastMining_Rank6!"); - } + if (getDebrisReduction(tier) < 0) { + reason.add("Skills.Mining.DebrisReduction_Rank" + tier.toNumerical() + " should be at least 0!"); + } - if (getBlastMiningRank6() > getBlastMiningRank7()) { - reason.add("Skills.Mining.BlastMining_Rank6 should be less or equal to Skills.Mining.BlastMining_Rank7!"); - } + if (getDropMultiplier(tier) < 0) { + reason.add("Skills.Mining.DropMultiplier_Rank" + tier.toNumerical() + " should be at least 0!"); + } - if (getBlastMiningRank7() > getBlastMiningRank8()) { - reason.add("Skills.Mining.BlastMining_Rank7 should be less or equal to Skills.Mining.BlastMining_Rank8!"); - } + if (getBlastRadiusModifier(tier) < 0) { + reason.add("Skills.Mining.BlastRadiusModifier_Rank" + tier.toNumerical() + " should be at least 0!"); + } - if (getBlastDamageDecreaseRank1() > getBlastDamageDecreaseRank2()) { - reason.add("Skills.Mining.BlastDamageDecrease_Rank1 should be less or equal to Skills.Mining.BlastDamageDecrease_Rank2!"); - } + if (tier != BlastMining.Tier.EIGHT) { + BlastMining.Tier nextTier = blastMiningTierList.get(blastMiningTierList.indexOf(tier) - 1); - if (getBlastDamageDecreaseRank2() > getBlastDamageDecreaseRank3()) { - reason.add("Skills.Mining.BlastDamageDecrease_Rank2 should be less or equal to Skills.Mining.BlastDamageDecrease_Rank3!"); - } + if (getBlastMiningRankLevel(tier) >= getBlastMiningRankLevel(nextTier)) { + reason.add("Skills.Mining.BlastMining_Rank" + tier.toNumerical() + " should be less than Skills.Mining.BlastMining_Rank" + nextTier.toNumerical() + "!"); + } - if (getBlastDamageDecreaseRank3() > getBlastDamageDecreaseRank4()) { - reason.add("Skills.Mining.BlastDamageDecrease_Rank3 should be less or equal to Skills.Mining.BlastDamageDecrease_Rank4!"); - } + if (getBlastDamageDecrease(tier) > getBlastDamageDecrease(nextTier)) { + reason.add("Skills.Mining.BlastDamageDecrease_Rank" + tier.toNumerical() + " should be less than or equal to Skills.Mining.BlastDamageDecrease_Rank" + nextTier.toNumerical() + "!"); + } - if (getBlastDamageDecreaseRank4() > getBlastDamageDecreaseRank5()) { - reason.add("Skills.Mining.BlastDamageDecrease_Rank4 should be less or equal to Skills.Mining.BlastDamageDecrease_Rank5!"); - } + if (getOreBonus(tier) > getOreBonus(nextTier)) { + reason.add("Skills.Mining.OreBonus_Rank" + tier.toNumerical() + " should be less than or equal to Skills.Mining.OreBonus_Rank" + nextTier.toNumerical() + "!"); + } - if (getBlastDamageDecreaseRank5() > getBlastDamageDecreaseRank6()) { - reason.add("Skills.Mining.BlastDamageDecrease_Rank5 should be less or equal to Skills.Mining.BlastDamageDecrease_Rank6!"); - } + if (getDebrisReduction(tier) > getDebrisReduction(nextTier)) { + reason.add("Skills.Mining.DebrisReduction_Rank" + tier.toNumerical() + " should be less than or equal to Skills.Mining.DebrisReduction_Rank" + nextTier.toNumerical() + "!"); + } - if (getBlastDamageDecreaseRank6() > getBlastDamageDecreaseRank7()) { - reason.add("Skills.Mining.BlastDamageDecrease_Rank6 should be less or equal to Skills.Mining.BlastDamageDecrease_Rank7!"); - } + if (getDropMultiplier(tier) > getDropMultiplier(nextTier)) { + reason.add("Skills.Mining.DropMultiplier_Rank" + tier.toNumerical() + " should be less than or equal to Skills.Mining.DropMultiplier_Rank" + nextTier.toNumerical() + "!"); + } - if (getBlastDamageDecreaseRank7() > getBlastDamageDecreaseRank8()) { - reason.add("Skills.Mining.BlastDamageDecrease_Rank7 should be less or equal to Skills.Mining.BlastDamageDecrease_Rank8!"); - } - - if (getOreBonusRank1() > getOreBonusRank2()) { - reason.add("Skills.Mining.OreBonus_Rank1 should be less or equal to Skills.Mining.OreBonus_Rank2!"); - } - - if (getOreBonusRank2() > getOreBonusRank3()) { - reason.add("Skills.Mining.OreBonus_Rank2 should be less or equal to Skills.Mining.OreBonus_Rank3!"); - } - - if (getOreBonusRank3() > getOreBonusRank4()) { - reason.add("Skills.Mining.OreBonus_Rank3 should be less or equal to Skills.Mining.OreBonus_Rank4!"); - } - - if (getOreBonusRank4() > getOreBonusRank5()) { - reason.add("Skills.Mining.OreBonus_Rank4 should be less or equal to Skills.Mining.OreBonus_Rank5!"); - } - - if (getOreBonusRank5() > getOreBonusRank6()) { - reason.add("Skills.Mining.OreBonus_Rank5 should be less or equal to Skills.Mining.OreBonus_Rank6!"); - } - - if (getOreBonusRank6() > getOreBonusRank7()) { - reason.add("Skills.Mining.OreBonus_Rank6 should be less or equal to Skills.Mining.OreBonus_Rank7!"); - } - - if (getOreBonusRank7() > getOreBonusRank8()) { - reason.add("Skills.Mining.OreBonus_Rank7 should be less or equal to Skills.Mining.OreBonus_Rank8!"); - } - - if (getDebrisReductionRank1() > getDebrisReductionRank2()) { - reason.add("Skills.Mining.DebrisReduction_Rank1 should be less or equal to Skills.Mining.DebrisReduction_Rank2!"); - } - - if (getDebrisReductionRank2() > getDebrisReductionRank3()) { - reason.add("Skills.Mining.DebrisReduction_Rank2 should be less or equal to Skills.Mining.DebrisReduction_Rank3!"); - } - - if (getDebrisReductionRank3() > getDebrisReductionRank4()) { - reason.add("Skills.Mining.DebrisReduction_Rank3 should be less or equal to Skills.Mining.DebrisReduction_Rank4!"); - } - - if (getDebrisReductionRank4() > getDebrisReductionRank5()) { - reason.add("Skills.Mining.DebrisReduction_Rank4 should be less or equal to Skills.Mining.DebrisReduction_Rank5!"); - } - - if (getDebrisReductionRank5() > getDebrisReductionRank6()) { - reason.add("Skills.Mining.DebrisReduction_Rank5 should be less or equal to Skills.Mining.DebrisReduction_Rank6!"); - } - - if (getDebrisReductionRank6() > getDebrisReductionRank7()) { - reason.add("Skills.Mining.DebrisReduction_Rank6 should be less or equal to Skills.Mining.DebrisReduction_Rank7!"); - } - - if (getDebrisReductionRank7() > getDebrisReductionRank8()) { - reason.add("Skills.Mining.DebrisReduction_Rank7 should be less or equal to Skills.Mining.DebrisReduction_Rank8!"); - } - - if (getDropMultiplierRank1() > getDropMultiplierRank2()) { - reason.add("Skills.Mining.DropMultiplier_Rank1 should be less or equal to Skills.Mining.DropMultiplier_Rank2!"); - } - - if (getDropMultiplierRank2() > getDropMultiplierRank3()) { - reason.add("Skills.Mining.DropMultiplier_Rank2 should be less or equal to Skills.Mining.DropMultiplier_Rank3!"); - } - - if (getDropMultiplierRank3() > getDropMultiplierRank4()) { - reason.add("Skills.Mining.DropMultiplier_Rank3 should be less or equal to Skills.Mining.DropMultiplier_Rank4!"); - } - - if (getDropMultiplierRank4() > getDropMultiplierRank5()) { - reason.add("Skills.Mining.DropMultiplier_Rank4 should be less or equal to Skills.Mining.DropMultiplier_Rank5!"); - } - - if (getDropMultiplierRank5() > getDropMultiplierRank6()) { - reason.add("Skills.Mining.DropMultiplier_Rank5 should be less or equal to Skills.Mining.DropMultiplier_Rank6!"); - } - - if (getDropMultiplierRank6() > getDropMultiplierRank7()) { - reason.add("Skills.Mining.DropMultiplier_Rank6 should be less or equal to Skills.Mining.DropMultiplier_Rank7!"); - } - - if (getDropMultiplierRank7() > getDropMultiplierRank8()) { - reason.add("Skills.Mining.DropMultiplier_Rank7 should be less or equal to Skills.Mining.DropMultiplier_Rank8!"); - } - - if (getBlastRadiusModifierRank1() > getBlastRadiusModifierRank2()) { - reason.add("Skills.Mining.BlastRadiusModifier_Rank1 should be less or equal to Skills.Mining.BlastRadiusModifier_Rank2!"); - } - - if (getBlastRadiusModifierRank2() > getBlastRadiusModifierRank3()) { - reason.add("Skills.Mining.BlastRadiusModifier_Rank2 should be less or equal to Skills.Mining.BlastRadiusModifier_Rank3!"); - } - - if (getBlastRadiusModifierRank3() > getBlastRadiusModifierRank4()) { - reason.add("Skills.Mining.BlastRadiusModifier_Rank3 should be less or equal to Skills.Mining.BlastRadiusModifier_Rank4!"); - } - - if (getBlastRadiusModifierRank4() > getBlastRadiusModifierRank5()) { - reason.add("Skills.Mining.BlastRadiusModifier_Rank4 should be less or equal to Skills.Mining.BlastRadiusModifier_Rank5!"); - } - - if (getBlastRadiusModifierRank5() > getBlastRadiusModifierRank6()) { - reason.add("Skills.Mining.BlastRadiusModifier_Rank5 should be less or equal to Skills.Mining.BlastRadiusModifier_Rank6!"); - } - - if (getBlastRadiusModifierRank6() > getBlastRadiusModifierRank7()) { - reason.add("Skills.Mining.BlastRadiusModifier_Rank6 should be less or equal to Skills.Mining.BlastRadiusModifier_Rank7!"); - } - - if (getBlastRadiusModifierRank7() > getBlastRadiusModifierRank8()) { - reason.add("Skills.Mining.BlastRadiusModifier_Rank7 should be less or equal to Skills.Mining.BlastRadiusModifier_Rank8!"); + if (getBlastRadiusModifier(tier) > getBlastRadiusModifier(nextTier)) { + reason.add("Skills.Mining.BlastRadiusModifier_Rank" + tier.toNumerical() + " should be less than or equal to Skills.Mining.BlastRadiusModifier_Rank" + nextTier.toNumerical() + "!"); + } + } } /* REPAIR */ @@ -540,100 +350,36 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { reason.add("Skills.Repair.Salvage_UnlockLevel should be at least 1!"); } - if (getArcaneForgingDowngradeChanceRank1() < 0 || getArcaneForgingDowngradeChanceRank1() > 100) { - reason.add("Skills.Repair.Arcane_Forging.Downgrades.Chance.Rank_1 only accepts values from 0 to 100!"); - } + List arcaneForgingTierList = Arrays.asList(ArcaneForging.Tier.values()); - if (getArcaneForgingDowngradeChanceRank2() < 0 || getArcaneForgingDowngradeChanceRank2() > 100) { - reason.add("Skills.Repair.Arcane_Forging.Downgrades.Chance.Rank_2 only accepts values from 0 to 100!"); - } + for (ArcaneForging.Tier tier : arcaneForgingTierList) { + if (getArcaneForgingRankLevel(tier) < 0) { + reason.add("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_" + tier.toNumerical() + " should be at least 0!"); + } - if (getArcaneForgingDowngradeChanceRank3() < 0 || getArcaneForgingDowngradeChanceRank3() > 100) { - reason.add("Skills.Repair.Arcane_Forging.Downgrades.Chance.Rank_3 only accepts values from 0 to 100!"); - } + if (getArcaneForgingDowngradeChance(tier) < 0 || getArcaneForgingDowngradeChance(tier) > 100) { + reason.add("Skills.Repair.Arcane_Forging.Downgrades.Chance.Rank_" + tier.toNumerical() + " only accepts values from 0 to 100!"); + } - if (getArcaneForgingDowngradeChanceRank4() < 0 || getArcaneForgingDowngradeChanceRank4() > 100) { - reason.add("Skills.Repair.Arcane_Forging.Downgrades.Chance.Rank_4 only accepts values from 0 to 100!"); - } + if (getArcaneForgingKeepEnchantsChance(tier) < 0 || getArcaneForgingKeepEnchantsChance(tier) > 100) { + reason.add("Skills.Repair.Arcane_Forging.Keep_Enchants.Chance.Rank_" + tier.toNumerical() + " only accepts values from 0 to 100!"); + } - if (getArcaneForgingDowngradeChanceRank5() < 0 || getArcaneForgingDowngradeChanceRank5() > 100) { - reason.add("Skills.Repair.Arcane_Forging.Downgrades.Chance.Rank_5 only accepts values from 0 to 100!"); - } + if (tier != ArcaneForging.Tier.EIGHT) { + ArcaneForging.Tier nextTier = arcaneForgingTierList.get(arcaneForgingTierList.indexOf(tier) - 1); - if (getArcaneForgingDowngradeChanceRank6() < 0 || getArcaneForgingDowngradeChanceRank6() > 100) { - reason.add("Skills.Repair.Arcane_Forging.Downgrades.Chance.Rank_6 only accepts values from 0 to 100!"); - } + if (getArcaneForgingRankLevel(tier) >= getArcaneForgingRankLevel(nextTier)) { + reason.add("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_" + tier.toNumerical() + " should be less than Skills.Repair.Arcane_Forging.Rank_Levels.Rank_" + nextTier.toNumerical() + "!"); + } - if (getArcaneForgingDowngradeChanceRank7() < 0 || getArcaneForgingDowngradeChanceRank7() > 100) { - reason.add("Skills.Repair.Arcane_Forging.Downgrades.Chance.Rank_7 only accepts values from 0 to 100!"); - } + if (getArcaneForgingDowngradeChance(nextTier) > getArcaneForgingDowngradeChance(tier)) { + reason.add("Skills.Repair.ArcaneForging.Downgrades.Chance.Rank_" + nextTier.toNumerical() + " should be less than or equal to Skills.Repair.ArcaneForging.Downgrades.Chance.Rank_" + tier.toNumerical() + "!"); + } - if (getArcaneForgingDowngradeChanceRank8() < 0 || getArcaneForgingDowngradeChanceRank8() > 100) { - reason.add("Skills.Repair.Arcane_Forging.Downgrades.Chance.Rank_8 only accepts values from 0 to 100!"); - } - - if (getArcaneForgingKeepEnchantsChanceRank1() < 0 || getArcaneForgingKeepEnchantsChanceRank1() > 100) { - reason.add("Skills.Repair.Arcane_Forging.Keep_Enchants.Chance.Rank_1 only accepts values from 0 to 100!"); - } - - if (getArcaneForgingKeepEnchantsChanceRank2() < 0 || getArcaneForgingKeepEnchantsChanceRank2() > 100) { - reason.add("Skills.Repair.Arcane_Forging.Keep_Enchants.Chance.Rank_2 only accepts values from 0 to 100!"); - } - - if (getArcaneForgingKeepEnchantsChanceRank3() < 0 || getArcaneForgingKeepEnchantsChanceRank3() > 100) { - reason.add("Skills.Repair.Arcane_Forging.Keep_Enchants.Chance.Rank_3 only accepts values from 0 to 100!"); - } - - if (getArcaneForgingKeepEnchantsChanceRank4() < 0 || getArcaneForgingKeepEnchantsChanceRank4() > 100) { - reason.add("Skills.Repair.Arcane_Forging.Keep_Enchants.Chance.Rank_4 only accepts values from 0 to 100!"); - } - - if (getArcaneForgingKeepEnchantsChanceRank5() < 0 || getArcaneForgingKeepEnchantsChanceRank5() > 100) { - reason.add("Skills.Repair.Arcane_Forging.Keep_Enchants.Chance.Rank_5 only accepts values from 0 to 100!"); - } - - if (getArcaneForgingKeepEnchantsChanceRank6() < 0 || getArcaneForgingKeepEnchantsChanceRank6() > 100) { - reason.add("Skills.Repair.Arcane_Forging.Keep_Enchants.Chance.Rank_6 only accepts values from 0 to 100!"); - } - - if (getArcaneForgingKeepEnchantsChanceRank7() < 0 || getArcaneForgingKeepEnchantsChanceRank7() > 100) { - reason.add("Skills.Repair.Arcane_Forging.Keep_Enchants.Chance.Rank_7 only accepts values from 0 to 100!"); - } - - if (getArcaneForgingKeepEnchantsChanceRank8() < 0 || getArcaneForgingKeepEnchantsChanceRank8() > 100) { - reason.add("Skills.Repair.Arcane_Forging.Keep_Enchants.Chance.Rank_8 only accepts values from 0 to 100!"); - } - - if (getArcaneForgingRankLevels1() < 0) { - reason.add("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_1 should be at least 0!"); - } - - if (getArcaneForgingRankLevels2() < 0) { - reason.add("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_2 should be at least 0!"); - } - - if (getArcaneForgingRankLevels3() < 0) { - reason.add("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_3 should be at least 0!"); - } - - if (getArcaneForgingRankLevels4() < 0) { - reason.add("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_4 should be at least 0!"); - } - - if (getArcaneForgingRankLevels5() < 0) { - reason.add("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_5 should be at least 0!"); - } - - if (getArcaneForgingRankLevels6() < 0) { - reason.add("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_6 should be at least 0!"); - } - - if (getArcaneForgingRankLevels7() < 0) { - reason.add("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_7 should be at least 0!"); - } - - if (getArcaneForgingRankLevels8() < 0) { - reason.add("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_8 should be at least 0!"); + if (getArcaneForgingKeepEnchantsChance(tier) > getArcaneForgingKeepEnchantsChance(nextTier)) { + reason.add("Skills.Repair.Arcane_Forging.Keep_Enchants.Chance.Rank_" + tier.toNumerical() + " should be less than or equal to Skills.Repair.Arcane_Forging.Keep_Enchants.Chance.Rank_" + nextTier.toNumerical() + "!"); + } + } } /* SMELTING */ @@ -661,64 +407,28 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { reason.add("Skills.Smelting.FluxMining_Chance should be at least 1!"); } - if (getSmeltingVanillaXPBoostRank1Level() > getSmeltingVanillaXPBoostRank2Level()) { - reason.add("Skills.Smelting.VanillaXPBoost_Rank1Level should be less or equal to Skills.Smelting.VanillaXPBoost_Rank2Level!"); - } + List smeltingTierList = Arrays.asList(Smelting.Tier.values()); - if (getSmeltingVanillaXPBoostRank2Level() > getSmeltingVanillaXPBoostRank3Level()) { - reason.add("Skills.Smelting.VanillaXPBoost_Rank2Level should be less or equal to Skills.Smelting.VanillaXPBoost_Rank3Level!"); - } + for (Smelting.Tier tier : smeltingTierList) { + if (getSmeltingVanillaXPBoostRankLevel(tier) < 0) { + reason.add("Skills.Smelting.VanillaXPBoost.Rank_Levels.Rank_" + tier.toNumerical() + " should be at least 0!"); + } - if (getSmeltingVanillaXPBoostRank3Level() > getSmeltingVanillaXPBoostRank4Level()) { - reason.add("Skills.Smelting.VanillaXPBoost_Rank3Level should be less or equal to Skills.Smelting.VanillaXPBoost_Rank4Level!"); - } + if (getSmeltingVanillaXPBoostMultiplier(tier) < 1) { + reason.add("Skills.Smelting.VanillaXPBoost.XP_Multiplier.Rank_" + tier.toNumerical() + " should be at least 1!"); + } - if (getSmeltingVanillaXPBoostRank4Level() > getSmeltingVanillaXPBoostRank5Level()) { - reason.add("Skills.Smelting.VanillaXPBoost_Rank4Level should be less or equal to Skills.Smelting.VanillaXPBoost_Rank5Level!"); - } + if (tier != Smelting.Tier.EIGHT) { + Smelting.Tier nextTier = smeltingTierList.get(smeltingTierList.indexOf(tier) - 1); - if (getSmeltingVanillaXPBoostRank5Level() > getSmeltingVanillaXPBoostRank6Level()) { - reason.add("Skills.Smelting.VanillaXPBoost_Rank5Level should be less or equal to Skills.Smelting.VanillaXPBoost_Rank6Level!"); - } + if (getSmeltingVanillaXPBoostRankLevel(tier) >= getSmeltingVanillaXPBoostRankLevel(nextTier)) { + reason.add("Skills.Smelting.VanillaXPBoost.Rank_Levels.Rank_" + tier.toNumerical() + " should be less than Skills.Smelting.VanillaXPBoost.Rank_Levels.Rank_" + nextTier.toNumerical() + "!"); + } - if (getSmeltingVanillaXPBoostRank6Level() > getSmeltingVanillaXPBoostRank7Level()) { - reason.add("Skills.Smelting.VanillaXPBoost_Rank6Level should be less or equal to Skills.Smelting.VanillaXPBoost_Rank7Level!"); - } - - if (getSmeltingVanillaXPBoostRank7Level() > getSmeltingVanillaXPBoostRank8Level()) { - reason.add("Skills.Smelting.VanillaXPBoost_Rank7Level should be less or equal to Skills.Smelting.VanillaXPBoost_Rank8Level!"); - } - - if (getSmeltingVanillaXPBoostRank1Multiplier() < 1) { - reason.add("Skills.Smelting.VanillaXPBoost_Rank1Multiplier should be at least 1!"); - } - - if (getSmeltingVanillaXPBoostRank2Multiplier() < 1) { - reason.add("Skills.Smelting.VanillaXPBoost_Rank2Multiplier should be at least 1!"); - } - - if (getSmeltingVanillaXPBoostRank3Multiplier() < 1) { - reason.add("Skills.Smelting.VanillaXPBoost_Rank3Multiplier should be at least 1!"); - } - - if (getSmeltingVanillaXPBoostRank4Multiplier() < 1) { - reason.add("Skills.Smelting.VanillaXPBoost_Rank4Multiplier should be at least 1!"); - } - - if (getSmeltingVanillaXPBoostRank5Multiplier() < 1) { - reason.add("Skills.Smelting.VanillaXPBoost_Rank5Multiplier should be at least 1!"); - } - - if (getSmeltingVanillaXPBoostRank6Multiplier() < 1) { - reason.add("Skills.Smelting.VanillaXPBoost_Rank6Multiplier should be at least 1!"); - } - - if (getSmeltingVanillaXPBoostRank7Multiplier() < 1) { - reason.add("Skills.Smelting.VanillaXPBoost_Rank7Multiplier should be at least 1!"); - } - - if (getSmeltingVanillaXPBoostRank8Multiplier() < 1) { - reason.add("Skills.Smelting.VanillaXPBoost_Rank8Multiplier should be at least 1!"); + if (getSmeltingVanillaXPBoostMultiplier(tier) > getSmeltingVanillaXPBoostRankLevel(nextTier)) { + reason.add("Skills.Smelting.VanillaXPBoost.XP_Multiplier.Rank_" + tier.toNumerical() + " should be less than or equal to Skills.Smelting.VanillaXPBoost.XP_Multiplier.Rank_" + nextTier.toNumerical() + "!"); + } + } } /* SWORDS */ @@ -959,14 +669,9 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { //Nothing to configure, everything is already configurable in config.yml /* FISHING */ - public int getFishingTierLevelsTier1() { return config.getInt("Skills.Fishing.Rank_Levels.Rank_1", 125); } - public int getFishingTierLevelsTier2() { return config.getInt("Skills.Fishing.Rank_Levels.Rank_2", 250); } - public int getFishingTierLevelsTier3() { return config.getInt("Skills.Fishing.Rank_Levels.Rank_3", 375); } - public int getFishingTierLevelsTier4() { return config.getInt("Skills.Fishing.Rank_Levels.Rank_4", 500); } - public int getFishingTierLevelsTier5() { return config.getInt("Skills.Fishing.Rank_Levels.Rank_5", 625); } - public int getFishingTierLevelsTier6() { return config.getInt("Skills.Fishing.Rank_Levels.Rank_6", 750); } - public int getFishingTierLevelsTier7() { return config.getInt("Skills.Fishing.Rank_Levels.Rank_7", 875); } - public int getFishingTierLevelsTier8() { return config.getInt("Skills.Fishing.Rank_Levels.Rank_8", 1000); } + public int getFishingTierLevel(Fishing.Tier tier) { return config.getInt("Skills.Fishing.Rank_Levels.Rank_" + tier.toNumerical()); } + public double getShakeChance(Fishing.Tier tier) { return config.getDouble("Skills.Fishing.Shake_Chance.Rank_" + tier.toNumerical()); } + public int getFishingVanillaXPModifier(Fishing.Tier tier) { return config.getInt("Skills.Fishing.VanillaXPBoost.Rank_" + tier.toNumerical()); } public double getFishingMagicMultiplier() { return config.getDouble("Skills.Fishing.MagicHunter_Multiplier", 5.0D); } @@ -974,26 +679,6 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { public int getIceFishingUnlockLevel() { return config.getInt("Skills.Fishing.Ice_Fishing_UnlockLevel", 50); } - /* Shake */ - public double getShakeChanceRank1() { return config.getDouble("Skills.Fishing.Shake_Chance.Rank_1", 25.0D); } - public double getShakeChanceRank2() { return config.getDouble("Skills.Fishing.Shake_Chance.Rank_2", 25.0D); } - public double getShakeChanceRank3() { return config.getDouble("Skills.Fishing.Shake_Chance.Rank_3", 35.0D); } - public double getShakeChanceRank4() { return config.getDouble("Skills.Fishing.Shake_Chance.Rank_4", 35.0D); } - public double getShakeChanceRank5() { return config.getDouble("Skills.Fishing.Shake_Chance.Rank_5", 45.0D); } - public double getShakeChanceRank6() { return config.getDouble("Skills.Fishing.Shake_Chance.Rank_6", 55.0D); } - public double getShakeChanceRank7() { return config.getDouble("Skills.Fishing.Shake_Chance.Rank_7", 65.0D); } - public double getShakeChanceRank8() { return config.getDouble("Skills.Fishing.Shake_Chance.Rank_8", 75.0D); } - - /* Vanilla XP Boost */ - public int getFishingVanillaXPModifierRank1() { return config.getInt("Skills.Fishing.VanillaXPBoost.Rank_1", 1); } - public int getFishingVanillaXPModifierRank2() { return config.getInt("Skills.Fishing.VanillaXPBoost.Rank_2", 1); } - public int getFishingVanillaXPModifierRank3() { return config.getInt("Skills.Fishing.VanillaXPBoost.Rank_3", 2); } - public int getFishingVanillaXPModifierRank4() { return config.getInt("Skills.Fishing.VanillaXPBoost.Rank_4", 2); } - public int getFishingVanillaXPModifierRank5() { return config.getInt("Skills.Fishing.VanillaXPBoost.Rank_5", 3); } - public int getFishingVanillaXPModifierRank6() { return config.getInt("Skills.Fishing.VanillaXPBoost.Rank_6", 4); } - public int getFishingVanillaXPModifierRank7() { return config.getInt("Skills.Fishing.VanillaXPBoost.Rank_7", 5); } - public int getFishingVanillaXPModifierRank8() { return config.getInt("Skills.Fishing.VanillaXPBoost.Rank_8", 6); } - /* HERBALISM */ public int getFarmerDietRankChange() { return config.getInt("Skills.Herbalism.Farmer_Diet_RankChange", 200); } @@ -1014,59 +699,12 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { public double getMiningDoubleDropChance() { return config.getDouble("Skills.Mining.DoubleDrops_ChanceMax", 100.0D); } public int getMiningDoubleDropMaxLevel() { return config.getInt("Skills.Mining.DoubleDrops_MaxBonusLevel", 1000); } - public int getBlastMiningRank1() { return config.getInt("Skills.Mining.BlastMining_Rank1", 125); } - public int getBlastMiningRank2() { return config.getInt("Skills.Mining.BlastMining_Rank2", 250); } - public int getBlastMiningRank3() { return config.getInt("Skills.Mining.BlastMining_Rank3", 375); } - public int getBlastMiningRank4() { return config.getInt("Skills.Mining.BlastMining_Rank4", 500); } - public int getBlastMiningRank5() { return config.getInt("Skills.Mining.BlastMining_Rank5", 625); } - public int getBlastMiningRank6() { return config.getInt("Skills.Mining.BlastMining_Rank6", 750); } - public int getBlastMiningRank7() { return config.getInt("Skills.Mining.BlastMining_Rank7", 875); } - public int getBlastMiningRank8() { return config.getInt("Skills.Mining.BlastMining_Rank8", 1000); } - - public double getBlastDamageDecreaseRank1() { return config.getDouble("Skills.Mining.BlastDamageDecrease_Rank1", 0.0D); } - public double getBlastDamageDecreaseRank2() { return config.getDouble("Skills.Mining.BlastDamageDecrease_Rank2", 0.0D); } - public double getBlastDamageDecreaseRank3() { return config.getDouble("Skills.Mining.BlastDamageDecrease_Rank3", 0.0D); } - public double getBlastDamageDecreaseRank4() { return config.getDouble("Skills.Mining.BlastDamageDecrease_Rank4", 25.0D); } - public double getBlastDamageDecreaseRank5() { return config.getDouble("Skills.Mining.BlastDamageDecrease_Rank5", 25.0D); } - public double getBlastDamageDecreaseRank6() { return config.getDouble("Skills.Mining.BlastDamageDecrease_Rank6", 50.0D); } - public double getBlastDamageDecreaseRank7() { return config.getDouble("Skills.Mining.BlastDamageDecrease_Rank7", 50.0D); } - public double getBlastDamageDecreaseRank8() { return config.getDouble("Skills.Mining.BlastDamageDecrease_Rank8", 100.0D); } - - public double getOreBonusRank1() { return config.getDouble("Skills.Mining.OreBonus_Rank1", 35.0D); } - public double getOreBonusRank2() { return config.getDouble("Skills.Mining.OreBonus_Rank2", 40.0D); } - public double getOreBonusRank3() { return config.getDouble("Skills.Mining.OreBonus_Rank3", 45.0D); } - public double getOreBonusRank4() { return config.getDouble("Skills.Mining.OreBonus_Rank4", 50.0D); } - public double getOreBonusRank5() { return config.getDouble("Skills.Mining.OreBonus_Rank5", 55.0D); } - public double getOreBonusRank6() { return config.getDouble("Skills.Mining.OreBonus_Rank6", 60.0D); } - public double getOreBonusRank7() { return config.getDouble("Skills.Mining.OreBonus_Rank7", 65.0D); } - public double getOreBonusRank8() { return config.getDouble("Skills.Mining.OreBonus_Rank8", 70.0D); } - - public double getDebrisReductionRank1() { return config.getDouble("Skills.Mining.DebrisReduction_Rank1", 10.0D); } - public double getDebrisReductionRank2() { return config.getDouble("Skills.Mining.DebrisReduction_Rank2", 20.0D); } - public double getDebrisReductionRank3() { return config.getDouble("Skills.Mining.DebrisReduction_Rank3", 30.0D); } - public double getDebrisReductionRank4() { return config.getDouble("Skills.Mining.DebrisReduction_Rank4", 30.0D); } - public double getDebrisReductionRank5() { return config.getDouble("Skills.Mining.DebrisReduction_Rank5", 30.0D); } - public double getDebrisReductionRank6() { return config.getDouble("Skills.Mining.DebrisReduction_Rank6", 30.0D); } - public double getDebrisReductionRank7() { return config.getDouble("Skills.Mining.DebrisReduction_Rank7", 30.0D); } - public double getDebrisReductionRank8() { return config.getDouble("Skills.Mining.DebrisReduction_Rank8", 30.0D); } - - public int getDropMultiplierRank1() { return config.getInt("Skills.Mining.DropMultiplier_Rank1", 1); } - public int getDropMultiplierRank2() { return config.getInt("Skills.Mining.DropMultiplier_Rank2", 1); } - public int getDropMultiplierRank3() { return config.getInt("Skills.Mining.DropMultiplier_Rank3", 1); } - public int getDropMultiplierRank4() { return config.getInt("Skills.Mining.DropMultiplier_Rank4", 1); } - public int getDropMultiplierRank5() { return config.getInt("Skills.Mining.DropMultiplier_Rank5", 2); } - public int getDropMultiplierRank6() { return config.getInt("Skills.Mining.DropMultiplier_Rank6", 2); } - public int getDropMultiplierRank7() { return config.getInt("Skills.Mining.DropMultiplier_Rank7", 3); } - public int getDropMultiplierRank8() { return config.getInt("Skills.Mining.DropMultiplier_Rank8", 3); } - - public double getBlastRadiusModifierRank1() { return config.getDouble("Skills.Mining.BlastRadiusModifier_Rank1", 1.0); } - public double getBlastRadiusModifierRank2() { return config.getDouble("Skills.Mining.BlastRadiusModifier_Rank2", 1.0); } - public double getBlastRadiusModifierRank3() { return config.getDouble("Skills.Mining.BlastRadiusModifier_Rank3", 2.0); } - public double getBlastRadiusModifierRank4() { return config.getDouble("Skills.Mining.BlastRadiusModifier_Rank4", 2.0); } - public double getBlastRadiusModifierRank5() { return config.getDouble("Skills.Mining.BlastRadiusModifier_Rank5", 3.0); } - public double getBlastRadiusModifierRank6() { return config.getDouble("Skills.Mining.BlastRadiusModifier_Rank6", 3.0); } - public double getBlastRadiusModifierRank7() { return config.getDouble("Skills.Mining.BlastRadiusModifier_Rank7", 4.0); } - public double getBlastRadiusModifierRank8() { return config.getDouble("Skills.Mining.BlastRadiusModifier_Rank8", 4.0); } + public int getBlastMiningRankLevel(BlastMining.Tier tier) { return config.getInt("Skills.Mining.BlastMining_Rank" + tier.toNumerical()); } + public double getBlastDamageDecrease(BlastMining.Tier tier) { return config.getDouble("Skills.Mining.BlastDamageDecrease_Rank" + tier.toNumerical()); } + public double getOreBonus(BlastMining.Tier tier) { return config.getDouble("Skills.Mining.OreBonus_Rank" + tier.toNumerical()); } + public double getDebrisReduction(BlastMining.Tier tier) { return config.getDouble("Skills.Mining.DebrisReduction_Rank" + tier.toNumerical()); } + public int getDropMultiplier(BlastMining.Tier tier) { return config.getInt("Skills.Mining.DropMultiplier_Rank" + tier.toNumerical()); } + public double getBlastRadiusModifier(BlastMining.Tier tier) { return config.getDouble("Skills.Mining.BlastRadiusModifier_Rank" + tier.toNumerical()); } /* REPAIR */ public double getRepairMasteryMaxBonus() { return config.getDouble("Skills.Repair.RepairMastery_MaxBonusPercentage", 200.0D); } @@ -1076,34 +714,13 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { public int getSalvageUnlockLevel() { return config.getInt("Skills.Repair.Salvage_UnlockLevel", 600); } /* Arcane Forging */ - public int getArcaneForgingRankLevels1() { return config.getInt("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_1", 125); } - public int getArcaneForgingRankLevels2() { return config.getInt("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_2", 250); } - public int getArcaneForgingRankLevels3() { return config.getInt("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_3", 375); } - public int getArcaneForgingRankLevels4() { return config.getInt("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_4", 500); } - public int getArcaneForgingRankLevels5() { return config.getInt("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_5", 625); } - public int getArcaneForgingRankLevels6() { return config.getInt("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_6", 750); } - public int getArcaneForgingRankLevels7() { return config.getInt("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_7", 875); } - public int getArcaneForgingRankLevels8() { return config.getInt("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_8", 1000); } + public int getArcaneForgingRankLevel(ArcaneForging.Tier tier) { return config.getInt("Skills.Repair.Arcane_Forging.Rank_Levels.Rank_" + tier.toNumerical()); } public boolean getArcaneForgingEnchantLossEnabled() { return config.getBoolean("Skills.Repair.Arcane_Forging.May_Lose_Enchants", true); } - public double getArcaneForgingKeepEnchantsChanceRank1() { return config.getDouble("Skills.Repair.Arcane_Forging.Keep_Enchants_Chance.Rank_1", 10.0D); } - public double getArcaneForgingKeepEnchantsChanceRank2() { return config.getDouble("Skills.Repair.Arcane_Forging.Keep_Enchants_Chance.Rank_2", 20.0D); } - public double getArcaneForgingKeepEnchantsChanceRank3() { return config.getDouble("Skills.Repair.Arcane_Forging.Keep_Enchants_Chance.Rank_3", 30.0D); } - public double getArcaneForgingKeepEnchantsChanceRank4() { return config.getDouble("Skills.Repair.Arcane_Forging.Keep_Enchants_Chance.Rank_4", 40.0D); } - public double getArcaneForgingKeepEnchantsChanceRank5() { return config.getDouble("Skills.Repair.Arcane_Forging.Keep_Enchants_Chance.Rank_5", 50.0D); } - public double getArcaneForgingKeepEnchantsChanceRank6() { return config.getDouble("Skills.Repair.Arcane_Forging.Keep_Enchants_Chance.Rank_6", 50.0D); } - public double getArcaneForgingKeepEnchantsChanceRank7() { return config.getDouble("Skills.Repair.Arcane_Forging.Keep_Enchants_Chance.Rank_7", 60.0D); } - public double getArcaneForgingKeepEnchantsChanceRank8() { return config.getDouble("Skills.Repair.Arcane_Forging.Keep_Enchants_Chance.Rank_8", 60.0D); } + public double getArcaneForgingKeepEnchantsChance(ArcaneForging.Tier tier) { return config.getDouble("Skills.Repair.Arcane_Forging.Keep_Enchants_Chance.Rank_" + tier.toNumerical()); } public boolean getArcaneForgingDowngradeEnabled() { return config.getBoolean("Skills.Repair.Arcane_Forging.Downgrades_Enabled", true); } - public double getArcaneForgingDowngradeChanceRank1() { return config.getDouble("Skills.Repair.Arcane_Forging.Downgrades_Chance.Rank_1", 75.0D); } - public double getArcaneForgingDowngradeChanceRank2() { return config.getDouble("Skills.Repair.Arcane_Forging.Downgrades_Chance.Rank_2", 50.0D); } - public double getArcaneForgingDowngradeChanceRank3() { return config.getDouble("Skills.Repair.Arcane_Forging.Downgrades_Chance.Rank_3", 40.0D); } - public double getArcaneForgingDowngradeChanceRank4() { return config.getDouble("Skills.Repair.Arcane_Forging.Downgrades_Chance.Rank_4", 30.0D); } - public double getArcaneForgingDowngradeChanceRank5() { return config.getDouble("Skills.Repair.Arcane_Forging.Downgrades_Chance.Rank_5", 25.0D); } - public double getArcaneForgingDowngradeChanceRank6() { return config.getDouble("Skills.Repair.Arcane_Forging.Downgrades_Chance.Rank_6", 20.0D); } - public double getArcaneForgingDowngradeChanceRank7() { return config.getDouble("Skills.Repair.Arcane_Forging.Downgrades_Chance.Rank_7", 15.0D); } - public double getArcaneForgingDowngradeChanceRank8() { return config.getDouble("Skills.Repair.Arcane_Forging.Downgrades_Chance.Rank_8", 10.0D); } + public double getArcaneForgingDowngradeChance(ArcaneForging.Tier tier) { return config.getDouble("Skills.Repair.Arcane_Forging.Downgrades_Chance.Rank_" + tier.toNumerical()); } /* SMELTING */ public int getBurnModifierMaxLevel() { return config.getInt("Skills.Smelting.FuelEfficiency_MaxBonusLevel", 1000); } @@ -1115,23 +732,8 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { public int getFluxMiningUnlockLevel() { return config.getInt("Skills.Smelting.FluxMining_UnlockLevel", 250); } public double getFluxMiningChance() { return config.getDouble("Skills.Smelting.FluxMining_Chance", 33.0D); } - public int getSmeltingVanillaXPBoostRank1Level() { return config.getInt("Skills.Smelting.VanillaXPBoost.Rank_Levels.Rank_1", 125); } - public int getSmeltingVanillaXPBoostRank2Level() { return config.getInt("Skills.Smelting.VanillaXPBoost.Rank_Levels.Rank_2", 250); } - public int getSmeltingVanillaXPBoostRank3Level() { return config.getInt("Skills.Smelting.VanillaXPBoost.Rank_Levels.Rank_3", 375); } - public int getSmeltingVanillaXPBoostRank4Level() { return config.getInt("Skills.Smelting.VanillaXPBoost.Rank_Levels.Rank_4", 500); } - public int getSmeltingVanillaXPBoostRank5Level() { return config.getInt("Skills.Smelting.VanillaXPBoost.Rank_Levels.Rank_5", 625); } - public int getSmeltingVanillaXPBoostRank6Level() { return config.getInt("Skills.Smelting.VanillaXPBoost.Rank_Levels.Rank_6", 750); } - public int getSmeltingVanillaXPBoostRank7Level() { return config.getInt("Skills.Smelting.VanillaXPBoost.Rank_Levels.Rank_7", 875); } - public int getSmeltingVanillaXPBoostRank8Level() { return config.getInt("Skills.Smelting.VanillaXPBoost.Rank_Levels.Rank_8", 1000); } - - public int getSmeltingVanillaXPBoostRank1Multiplier() { return config.getInt("Skills.Smelting.VanillaXPBoost.XP_Multiplier.Rank_1", 1); } - public int getSmeltingVanillaXPBoostRank2Multiplier() { return config.getInt("Skills.Smelting.VanillaXPBoost.XP_Multiplier.Rank_2", 2); } - public int getSmeltingVanillaXPBoostRank3Multiplier() { return config.getInt("Skills.Smelting.VanillaXPBoost.XP_Multiplier.Rank_3", 3); } - public int getSmeltingVanillaXPBoostRank4Multiplier() { return config.getInt("Skills.Smelting.VanillaXPBoost.XP_Multiplier.Rank_4", 3); } - public int getSmeltingVanillaXPBoostRank5Multiplier() { return config.getInt("Skills.Smelting.VanillaXPBoost.XP_Multiplier.Rank_5", 4); } - public int getSmeltingVanillaXPBoostRank6Multiplier() { return config.getInt("Skills.Smelting.VanillaXPBoost.XP_Multiplier.Rank_6", 4); } - public int getSmeltingVanillaXPBoostRank7Multiplier() { return config.getInt("Skills.Smelting.VanillaXPBoost.XP_Multiplier.Rank_7", 5); } - public int getSmeltingVanillaXPBoostRank8Multiplier() { return config.getInt("Skills.Smelting.VanillaXPBoost.XP_Multiplier.Rank_8", 5); } + public int getSmeltingVanillaXPBoostRankLevel(Smelting.Tier tier) { return config.getInt("Skills.Smelting.VanillaXPBoost.Rank_Levels.Rank_" + tier.toNumerical()); } + public int getSmeltingVanillaXPBoostMultiplier(Smelting.Tier tier) { return config.getInt("Skills.Smelting.VanillaXPBoost.XP_Multiplier.Rank_" + tier.toNumerical()); } /* SWORDS */ public double getBleedChanceMax() { return config.getDouble("Skills.Swords.Bleed_ChanceMax", 75.0D); } diff --git a/src/main/java/com/gmail/nossr50/skills/fishing/Fishing.java b/src/main/java/com/gmail/nossr50/skills/fishing/Fishing.java index 435c4019e..026bee8ff 100644 --- a/src/main/java/com/gmail/nossr50/skills/fishing/Fishing.java +++ b/src/main/java/com/gmail/nossr50/skills/fishing/Fishing.java @@ -15,39 +15,15 @@ import com.gmail.nossr50.util.Misc; public final class Fishing { // The order of the values is extremely important, a few methods depend on it to work properly - protected enum Tier { - EIGHT(8) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getFishingTierLevelsTier8(); } - @Override public double getShakeChance() { return AdvancedConfig.getInstance().getShakeChanceRank8(); } - @Override public int getVanillaXPBoostModifier() { return AdvancedConfig.getInstance().getFishingVanillaXPModifierRank8(); }}, - SEVEN(7) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getFishingTierLevelsTier7(); } - @Override public double getShakeChance() { return AdvancedConfig.getInstance().getShakeChanceRank7(); } - @Override public int getVanillaXPBoostModifier() { return AdvancedConfig.getInstance().getFishingVanillaXPModifierRank7(); }}, - SIX(6) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getFishingTierLevelsTier6(); } - @Override public double getShakeChance() { return AdvancedConfig.getInstance().getShakeChanceRank6(); } - @Override public int getVanillaXPBoostModifier() { return AdvancedConfig.getInstance().getFishingVanillaXPModifierRank6(); }}, - FIVE(5) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getFishingTierLevelsTier5(); } - @Override public double getShakeChance() { return AdvancedConfig.getInstance().getShakeChanceRank5(); } - @Override public int getVanillaXPBoostModifier() { return AdvancedConfig.getInstance().getFishingVanillaXPModifierRank5(); }}, - FOUR(4) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getFishingTierLevelsTier4(); } - @Override public double getShakeChance() { return AdvancedConfig.getInstance().getShakeChanceRank4(); } - @Override public int getVanillaXPBoostModifier() { return AdvancedConfig.getInstance().getFishingVanillaXPModifierRank4(); }}, - THREE(3) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getFishingTierLevelsTier3(); } - @Override public double getShakeChance() { return AdvancedConfig.getInstance().getShakeChanceRank3(); } - @Override public int getVanillaXPBoostModifier() { return AdvancedConfig.getInstance().getFishingVanillaXPModifierRank3(); }}, - TWO(2) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getFishingTierLevelsTier2(); } - @Override public double getShakeChance() { return AdvancedConfig.getInstance().getShakeChanceRank2(); } - @Override public int getVanillaXPBoostModifier() { return AdvancedConfig.getInstance().getFishingVanillaXPModifierRank2(); }}, - ONE(1) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getFishingTierLevelsTier1(); } - @Override public double getShakeChance() { return AdvancedConfig.getInstance().getShakeChanceRank1(); } - @Override public int getVanillaXPBoostModifier() { return AdvancedConfig.getInstance().getFishingVanillaXPModifierRank1(); }}; + public enum Tier { + EIGHT(8), + SEVEN(7), + SIX(6), + FIVE(5), + FOUR(4), + THREE(3), + TWO(2), + ONE(1); int numerical; @@ -59,9 +35,17 @@ public final class Fishing { return numerical; } - abstract protected int getLevel(); - abstract protected double getShakeChance(); - abstract protected int getVanillaXPBoostModifier(); + protected int getLevel() { + return AdvancedConfig.getInstance().getFishingTierLevel(this); + } + + protected double getShakeChance() { + return AdvancedConfig.getInstance().getShakeChance(this); + } + + protected int getVanillaXPBoostModifier() { + return AdvancedConfig.getInstance().getFishingVanillaXPModifier(this); + } } protected static final HashMap> ENCHANTABLE_CACHE = new HashMap>(); diff --git a/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java b/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java index a10c06d54..c53a719f6 100644 --- a/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java +++ b/src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java @@ -68,7 +68,7 @@ public class FishingManager extends SkillManager { } public boolean canShake(Entity target) { - return target instanceof LivingEntity && getSkillLevel() >= AdvancedConfig.getInstance().getFishingTierLevelsTier1() && Permissions.shake(getPlayer()); + return target instanceof LivingEntity && getSkillLevel() >= Tier.ONE.getLevel() && Permissions.shake(getPlayer()); } public boolean canMasterAngler() { diff --git a/src/main/java/com/gmail/nossr50/skills/mining/BlastMining.java b/src/main/java/com/gmail/nossr50/skills/mining/BlastMining.java index 0bbd8c454..ac76e6d5e 100644 --- a/src/main/java/com/gmail/nossr50/skills/mining/BlastMining.java +++ b/src/main/java/com/gmail/nossr50/skills/mining/BlastMining.java @@ -7,63 +7,15 @@ import com.gmail.nossr50.config.Config; public class BlastMining { // The order of the values is extremely important, a few methods depend on it to work properly - protected enum Tier { - EIGHT(8) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getBlastMiningRank8(); } - @Override public double getBlastRadiusModifier() { return AdvancedConfig.getInstance().getBlastRadiusModifierRank8(); } - @Override public double getOreBonus() { return AdvancedConfig.getInstance().getOreBonusRank8(); } - @Override public double getDebrisReduction() { return AdvancedConfig.getInstance().getDebrisReductionRank8(); } - @Override public double getBlastDamageDecrease() { return AdvancedConfig.getInstance().getBlastDamageDecreaseRank8(); } - @Override public int getDropMultiplier() { return AdvancedConfig.getInstance().getDropMultiplierRank8(); }}, - SEVEN(7) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getBlastMiningRank7(); } - @Override public double getBlastRadiusModifier() { return AdvancedConfig.getInstance().getBlastRadiusModifierRank7(); } - @Override public double getOreBonus() { return AdvancedConfig.getInstance().getOreBonusRank7(); } - @Override public double getDebrisReduction() { return AdvancedConfig.getInstance().getDebrisReductionRank7(); } - @Override public double getBlastDamageDecrease() { return AdvancedConfig.getInstance().getBlastDamageDecreaseRank7(); } - @Override public int getDropMultiplier() { return AdvancedConfig.getInstance().getDropMultiplierRank7(); }}, - SIX(6) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getBlastMiningRank6(); } - @Override public double getBlastRadiusModifier() { return AdvancedConfig.getInstance().getBlastRadiusModifierRank6(); } - @Override public double getOreBonus() { return AdvancedConfig.getInstance().getOreBonusRank6(); } - @Override public double getDebrisReduction() { return AdvancedConfig.getInstance().getDebrisReductionRank6(); } - @Override public double getBlastDamageDecrease() { return AdvancedConfig.getInstance().getBlastDamageDecreaseRank6(); } - @Override public int getDropMultiplier() { return AdvancedConfig.getInstance().getDropMultiplierRank6(); }}, - FIVE(5) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getBlastMiningRank5(); } - @Override public double getBlastRadiusModifier() { return AdvancedConfig.getInstance().getBlastRadiusModifierRank5(); } - @Override public double getOreBonus() { return AdvancedConfig.getInstance().getOreBonusRank5(); } - @Override public double getDebrisReduction() { return AdvancedConfig.getInstance().getDebrisReductionRank5(); } - @Override public double getBlastDamageDecrease() { return AdvancedConfig.getInstance().getBlastDamageDecreaseRank5(); } - @Override public int getDropMultiplier() { return AdvancedConfig.getInstance().getDropMultiplierRank5(); }}, - FOUR(4) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getBlastMiningRank4(); } - @Override public double getBlastRadiusModifier() { return AdvancedConfig.getInstance().getBlastRadiusModifierRank4(); } - @Override public double getOreBonus() { return AdvancedConfig.getInstance().getOreBonusRank4(); } - @Override public double getDebrisReduction() { return AdvancedConfig.getInstance().getDebrisReductionRank4(); } - @Override public double getBlastDamageDecrease() { return AdvancedConfig.getInstance().getBlastDamageDecreaseRank4(); } - @Override public int getDropMultiplier() { return AdvancedConfig.getInstance().getDropMultiplierRank4(); }}, - THREE(3) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getBlastMiningRank3(); } - @Override public double getBlastRadiusModifier() { return AdvancedConfig.getInstance().getBlastRadiusModifierRank3(); } - @Override public double getOreBonus() { return AdvancedConfig.getInstance().getOreBonusRank3(); } - @Override public double getDebrisReduction() { return AdvancedConfig.getInstance().getDebrisReductionRank3(); } - @Override public double getBlastDamageDecrease() { return AdvancedConfig.getInstance().getBlastDamageDecreaseRank3(); } - @Override public int getDropMultiplier() { return AdvancedConfig.getInstance().getDropMultiplierRank3(); }}, - TWO(2) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getBlastMiningRank2(); } - @Override public double getBlastRadiusModifier() { return AdvancedConfig.getInstance().getBlastRadiusModifierRank2(); } - @Override public double getOreBonus() { return AdvancedConfig.getInstance().getOreBonusRank2(); } - @Override public double getDebrisReduction() { return AdvancedConfig.getInstance().getDebrisReductionRank2(); } - @Override public double getBlastDamageDecrease() { return AdvancedConfig.getInstance().getBlastDamageDecreaseRank2(); } - @Override public int getDropMultiplier() { return AdvancedConfig.getInstance().getDropMultiplierRank2(); }}, - ONE(1) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getBlastMiningRank1(); } - @Override public double getBlastRadiusModifier() { return AdvancedConfig.getInstance().getBlastRadiusModifierRank1(); } - @Override public double getOreBonus() { return AdvancedConfig.getInstance().getOreBonusRank1(); } - @Override public double getDebrisReduction() { return AdvancedConfig.getInstance().getDebrisReductionRank1(); } - @Override public double getBlastDamageDecrease() { return AdvancedConfig.getInstance().getBlastDamageDecreaseRank1(); } - @Override public int getDropMultiplier() { return AdvancedConfig.getInstance().getDropMultiplierRank1(); }}; + public enum Tier { + EIGHT(8), + SEVEN(7), + SIX(6), + FIVE(5), + FOUR(4), + THREE(3), + TWO(2), + ONE(1); int numerical; @@ -75,12 +27,29 @@ public class BlastMining { return numerical; } - abstract protected int getLevel(); - abstract protected double getBlastRadiusModifier(); - abstract protected double getOreBonus(); - abstract protected double getDebrisReduction(); - abstract protected double getBlastDamageDecrease(); - abstract protected int getDropMultiplier(); + protected int getLevel() { + return AdvancedConfig.getInstance().getBlastMiningRankLevel(this); + } + + protected double getBlastRadiusModifier() { + return AdvancedConfig.getInstance().getBlastRadiusModifier(this); + } + + protected double getOreBonus() { + return AdvancedConfig.getInstance().getOreBonus(this); + } + + protected double getDebrisReduction() { + return AdvancedConfig.getInstance().getDebrisReduction(this); + } + + protected double getBlastDamageDecrease() { + return AdvancedConfig.getInstance().getBlastDamageDecrease(this); + } + + protected int getDropMultiplier() { + return AdvancedConfig.getInstance().getDropMultiplier(this); + } } public static Material detonator = Config.getInstance().getDetonatorItem(); diff --git a/src/main/java/com/gmail/nossr50/skills/repair/ArcaneForging.java b/src/main/java/com/gmail/nossr50/skills/repair/ArcaneForging.java index eeb50eba1..9081241ea 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/ArcaneForging.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/ArcaneForging.java @@ -4,39 +4,15 @@ import com.gmail.nossr50.config.AdvancedConfig; public class ArcaneForging { // The order of the values is extremely important, a few methods depend on it to work properly - protected enum Tier { - EIGHT(8) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getArcaneForgingRankLevels8(); } - @Override public double getKeepEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingKeepEnchantsChanceRank8(); } - @Override public double getDowngradeEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingDowngradeChanceRank8(); }}, - SEVEN(7) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getArcaneForgingRankLevels7(); } - @Override public double getKeepEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingKeepEnchantsChanceRank7(); } - @Override public double getDowngradeEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingDowngradeChanceRank7(); }}, - SIX(6) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getArcaneForgingRankLevels6(); } - @Override public double getKeepEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingKeepEnchantsChanceRank6(); } - @Override public double getDowngradeEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingDowngradeChanceRank6(); }}, - FIVE(5) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getArcaneForgingRankLevels5(); } - @Override public double getKeepEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingKeepEnchantsChanceRank5(); } - @Override public double getDowngradeEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingDowngradeChanceRank5(); }}, - FOUR(4) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getArcaneForgingRankLevels4(); } - @Override public double getKeepEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingKeepEnchantsChanceRank4(); } - @Override public double getDowngradeEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingDowngradeChanceRank4(); }}, - THREE(3) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getArcaneForgingRankLevels3(); } - @Override public double getKeepEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingKeepEnchantsChanceRank3(); } - @Override public double getDowngradeEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingDowngradeChanceRank3(); }}, - TWO(2) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getArcaneForgingRankLevels2(); } - @Override public double getKeepEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingKeepEnchantsChanceRank2(); } - @Override public double getDowngradeEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingDowngradeChanceRank2(); }}, - ONE(1) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getArcaneForgingRankLevels1(); } - @Override public double getKeepEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingKeepEnchantsChanceRank1(); } - @Override public double getDowngradeEnchantChance() { return AdvancedConfig.getInstance().getArcaneForgingDowngradeChanceRank1(); }}; + public enum Tier { + EIGHT(8), + SEVEN(7), + SIX(6), + FIVE(5), + FOUR(4), + THREE(3), + TWO(2), + ONE(1); int numerical; @@ -48,9 +24,17 @@ public class ArcaneForging { return numerical; } - abstract protected int getLevel(); - abstract protected double getKeepEnchantChance(); - abstract protected double getDowngradeEnchantChance(); + protected int getLevel() { + return AdvancedConfig.getInstance().getArcaneForgingRankLevel(this); + } + + protected double getKeepEnchantChance() { + return AdvancedConfig.getInstance().getArcaneForgingKeepEnchantsChance(this); + } + + protected double getDowngradeEnchantChance() { + return AdvancedConfig.getInstance().getArcaneForgingDowngradeChance(this); + } } public static boolean arcaneForgingDowngrades = AdvancedConfig.getInstance().getArcaneForgingDowngradeEnabled(); diff --git a/src/main/java/com/gmail/nossr50/skills/smelting/Smelting.java b/src/main/java/com/gmail/nossr50/skills/smelting/Smelting.java index e6da32d25..50d6eadc5 100644 --- a/src/main/java/com/gmail/nossr50/skills/smelting/Smelting.java +++ b/src/main/java/com/gmail/nossr50/skills/smelting/Smelting.java @@ -8,31 +8,15 @@ import com.gmail.nossr50.datatypes.skills.SkillType; public class Smelting { // The order of the values is extremely important, a few methods depend on it to work properly - protected enum Tier { - EIGHT(8) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank8Level(); } - @Override public int getVanillaXPBoostModifier() { return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank8Multiplier(); }}, - SEVEN(7) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank7Level(); } - @Override public int getVanillaXPBoostModifier() { return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank7Multiplier(); }}, - SIX(6) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank6Level(); } - @Override public int getVanillaXPBoostModifier() { return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank6Multiplier(); }}, - FIVE(5) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank5Level(); } - @Override public int getVanillaXPBoostModifier() { return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank5Multiplier(); }}, - FOUR(4) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank4Level(); } - @Override public int getVanillaXPBoostModifier() { return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank4Multiplier(); }}, - THREE(3) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank3Level(); } - @Override public int getVanillaXPBoostModifier() { return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank3Multiplier(); }}, - TWO(2) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank2Level(); } - @Override public int getVanillaXPBoostModifier() { return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank2Multiplier(); }}, - ONE(1) { - @Override public int getLevel() { return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank1Level(); } - @Override public int getVanillaXPBoostModifier() { return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank1Multiplier(); }}; + public enum Tier { + EIGHT(8), + SEVEN(7), + SIX(6), + FIVE(5), + FOUR(4), + THREE(3), + TWO(2), + ONE(1); int numerical; @@ -44,8 +28,13 @@ public class Smelting { return numerical; } - abstract protected int getLevel(); - abstract protected int getVanillaXPBoostModifier(); + protected int getLevel() { + return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRankLevel(this); + } + + protected int getVanillaXPBoostModifier() { + return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostMultiplier(this); + } } public static int burnModifierMaxLevel = AdvancedConfig.getInstance().getBurnModifierMaxLevel(); diff --git a/src/main/resources/locale/locale_en_US.properties b/src/main/resources/locale/locale_en_US.properties index 7fc6854a1..9f4b661ea 100644 --- a/src/main/resources/locale/locale_en_US.properties +++ b/src/main/resources/locale/locale_en_US.properties @@ -103,7 +103,7 @@ Fishing.Ability.Chance=[[RED]]Bite Chance: [[YELLOW]]{0} Fishing.Ability.Info=[[RED]]Magic Hunter: [[GRAY]] **Improves With Treasure Hunter Rank** Fishing.Ability.Locked.0=LOCKED UNTIL {0}+ SKILL (SHAKE) Fishing.Ability.Locked.1=LOCKED UNTIL {0}+ SKILL (ICE FISHING) -Fishing.Ability.Rank=[[RED]]Treasure Hunter Rank: [[YELLOW]]{0}/5 +Fishing.Ability.Rank=[[RED]]Treasure Hunter Rank: [[YELLOW]]{0}/{1} Fishing.Ability.Shake=[[RED]]Shake Chance: [[YELLOW]]{0} Fishing.Ability.IceFishing=[[RED]]Ice Fishing: Go fishing in ice Fishing.Ability.FD=[[RED]]Fisherman''s Diet: [[YELLOW]]Rank {0} @@ -197,7 +197,7 @@ Mining.Skillup=[[YELLOW]]Mining skill increased by {0}. Total ({1}) Mining.Blast.Boom=[[GRAY]]**BOOM** Mining.Blast.Effect=+{0} ore yield, -{1} debris yield, {2}x drops Mining.Blast.Radius.Increase=[[RED]]Blast Radius Increase: [[YELLOW]]+{0} -Mining.Blast.Rank=[[RED]]Blast Mining: [[YELLOW]] Rank {0}/8 [[GRAY]]({1}) +Mining.Blast.Rank=[[RED]]Blast Mining: [[YELLOW]] Rank {0}/{1} [[GRAY]]({2}) Mining.Blast.Other.On=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Blast Mining! Mining.Blast.Refresh=[[GREEN]]Your [[YELLOW]]Blast Mining [[GREEN]]ability is refreshed! @@ -249,7 +249,7 @@ Repair.Arcane.Downgrade=[[RED]]Arcane power has decreased for this item. Repair.Arcane.Fail=[[RED]]Arcane power has permanently left the item. Repair.Arcane.Lost=[[RED]]You were not skilled enough to keep any enchantments. Repair.Arcane.Perfect=[[GREEN]]You have sustained the arcane energies in this item. -Repair.Arcane.Rank=[[RED]]Arcane Forging: [[YELLOW]]Rank {0}/4 +Repair.Arcane.Rank=[[RED]]Arcane Forging: [[YELLOW]]Rank {0}/{1} #SWORDS Swords.Ability.Lower=[[GRAY]]**YOU LOWER YOUR SWORD**