From 234a31d2834c966da21a02f9d3869498237c0721 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 5 Mar 2019 21:29:41 -0800 Subject: [PATCH] Fix Repair Mastery zero initialize --- .../java/com/gmail/nossr50/config/AdvancedConfig.java | 11 ++++++----- .../java/com/gmail/nossr50/skills/repair/Repair.java | 8 +++----- .../gmail/nossr50/skills/repair/RepairManager.java | 1 - 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java index f10da2e04..5669c572e 100644 --- a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java +++ b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java @@ -350,12 +350,13 @@ public class AdvancedConfig extends ConfigValidated { } /* REPAIR */ - if (getRepairMasteryMaxBonus() < 1) { - reason.add(SKILLS + "." + REPAIR + "." + REPAIR_MASTERY + "." + MAX_BONUS_PERCENTAGE + " should be at least 1!"); - } - + /* if (getRepairMasteryMaxLevel() < 1) { reason.add(SKILLS + "." + REPAIR + "." + REPAIR_MASTERY + "." + MAX_BONUS_LEVEL + " should be at least 1!"); + }*/ + + if (getRepairMasteryMaxBonus() < 1) { + reason.add(SKILLS + "." + REPAIR + "." + REPAIR_MASTERY + "." + MAX_BONUS_PERCENTAGE + " should be at least 1!"); } if (getMaximumProbability(SubSkillType.REPAIR_SUPER_REPAIR) < 1) { @@ -671,7 +672,7 @@ public class AdvancedConfig extends ConfigValidated { /* REPAIR */ public double getRepairMasteryMaxBonus() { return getDoubleValue(SKILLS, REPAIR, REPAIR_MASTERY, MAX_BONUS_PERCENTAGE); } - public int getRepairMasteryMaxLevel() { return getIntValue(SKILLS, REPAIR, REPAIR_MASTERY, MAX_BONUS_LEVEL); } + //public int getRepairMasteryMaxLevel() { return getIntValue(SKILLS, REPAIR, REPAIR_MASTERY, MAX_BONUS_LEVEL); } /* Arcane Forging */ public boolean getArcaneForgingEnchantLossEnabled() { return getBooleanValue(SKILLS, REPAIR, ARCANE_FORGING, MAY_LOSE_ENCHANTS); } diff --git a/src/main/java/com/gmail/nossr50/skills/repair/Repair.java b/src/main/java/com/gmail/nossr50/skills/repair/Repair.java index ce107528c..7b57702b4 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/Repair.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/Repair.java @@ -1,13 +1,11 @@ package com.gmail.nossr50.skills.repair; -import com.gmail.nossr50.config.AdvancedConfig; -import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.config.MainConfig; import org.bukkit.Material; public class Repair { - public static int repairMasteryMaxBonusLevel = AdvancedConfig.getInstance().getMaxBonusLevel(SubSkillType.REPAIR_REPAIR_MASTERY); - public static double repairMasteryMaxBonus = AdvancedConfig.getInstance().getRepairMasteryMaxBonus(); + //public static int repairMasteryMaxBonusLevel = AdvancedConfig.getInstance().getRepairMasteryMaxLevel(); + //public static double repairMasteryMaxBonus = AdvancedConfig.getInstance().getRepairMasteryMaxBonus(); - public static Material anvilMaterial = MainConfig.getInstance().getRepairAnvilMaterial(); + //public static Material anvilMaterial = MainConfig.getInstance().getRepairAnvilMaterial(); } diff --git a/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java b/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java index 119ad2108..ae416dcb5 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java @@ -269,7 +269,6 @@ public class RepairManager extends SkillManager { double skillLevelBonusCalc = (Repair.repairMasteryMaxBonus / Repair.repairMasteryMaxBonusLevel) * (getSkillLevel() / 100.0D); double bonus = repairAmount * Math.min(skillLevelBonusCalc, maxBonusCalc); - repairAmount += bonus; }