Fix Repair Mastery zero initialize

This commit is contained in:
nossr50 2019-03-05 21:29:41 -08:00
parent f2945569fb
commit 234a31d283
3 changed files with 9 additions and 11 deletions

View File

@ -350,12 +350,13 @@ public class AdvancedConfig extends ConfigValidated {
} }
/* REPAIR */ /* REPAIR */
if (getRepairMasteryMaxBonus() < 1) { /*
reason.add(SKILLS + "." + REPAIR + "." + REPAIR_MASTERY + "." + MAX_BONUS_PERCENTAGE + " should be at least 1!");
}
if (getRepairMasteryMaxLevel() < 1) { if (getRepairMasteryMaxLevel() < 1) {
reason.add(SKILLS + "." + REPAIR + "." + REPAIR_MASTERY + "." + MAX_BONUS_LEVEL + " should be at least 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) { if (getMaximumProbability(SubSkillType.REPAIR_SUPER_REPAIR) < 1) {
@ -671,7 +672,7 @@ public class AdvancedConfig extends ConfigValidated {
/* REPAIR */ /* REPAIR */
public double getRepairMasteryMaxBonus() { return getDoubleValue(SKILLS, REPAIR, REPAIR_MASTERY, MAX_BONUS_PERCENTAGE); } 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 */ /* Arcane Forging */
public boolean getArcaneForgingEnchantLossEnabled() { return getBooleanValue(SKILLS, REPAIR, ARCANE_FORGING, MAY_LOSE_ENCHANTS); } public boolean getArcaneForgingEnchantLossEnabled() { return getBooleanValue(SKILLS, REPAIR, ARCANE_FORGING, MAY_LOSE_ENCHANTS); }

View File

@ -1,13 +1,11 @@
package com.gmail.nossr50.skills.repair; 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 com.gmail.nossr50.config.MainConfig;
import org.bukkit.Material; import org.bukkit.Material;
public class Repair { public class Repair {
public static int repairMasteryMaxBonusLevel = AdvancedConfig.getInstance().getMaxBonusLevel(SubSkillType.REPAIR_REPAIR_MASTERY); //public static int repairMasteryMaxBonusLevel = AdvancedConfig.getInstance().getRepairMasteryMaxLevel();
public static double repairMasteryMaxBonus = AdvancedConfig.getInstance().getRepairMasteryMaxBonus(); //public static double repairMasteryMaxBonus = AdvancedConfig.getInstance().getRepairMasteryMaxBonus();
public static Material anvilMaterial = MainConfig.getInstance().getRepairAnvilMaterial(); //public static Material anvilMaterial = MainConfig.getInstance().getRepairAnvilMaterial();
} }

View File

@ -269,7 +269,6 @@ public class RepairManager extends SkillManager {
double skillLevelBonusCalc = (Repair.repairMasteryMaxBonus / Repair.repairMasteryMaxBonusLevel) * (getSkillLevel() / 100.0D); double skillLevelBonusCalc = (Repair.repairMasteryMaxBonus / Repair.repairMasteryMaxBonusLevel) * (getSkillLevel() / 100.0D);
double bonus = repairAmount * Math.min(skillLevelBonusCalc, maxBonusCalc); double bonus = repairAmount * Math.min(skillLevelBonusCalc, maxBonusCalc);
repairAmount += bonus; repairAmount += bonus;
} }