From a3b8ab81bea919119da949af8be40c2b010ac42a Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 5 Mar 2019 21:38:50 -0800 Subject: [PATCH] Fixed zero initialize for Smelting's Fuel Efficiency --- .../java/com/gmail/nossr50/commands/skills/RepairCommand.java | 3 ++- .../com/gmail/nossr50/commands/skills/SmeltingCommand.java | 1 + src/main/java/com/gmail/nossr50/config/AdvancedConfig.java | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) 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 cd41d6ac8..d0846621c 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java @@ -1,5 +1,6 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.datatypes.skills.MaterialType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType; @@ -63,7 +64,7 @@ public class RepairCommand extends SkillCommand { // REPAIR MASTERY if (canMasterRepair) { - repairMasteryBonus = percent.format(Math.min(((Repair.repairMasteryMaxBonus / Repair.repairMasteryMaxBonusLevel) * skillValue), Repair.repairMasteryMaxBonus) / 100D); + repairMasteryBonus = percent.format(Math.min(((AdvancedConfig.getInstance().getRepairMasteryMaxBonus() / AdvancedConfig.getInstance().getMaxBonusLevel(SubSkillType.REPAIR_REPAIR_MASTERY)) * skillValue), AdvancedConfig.getInstance().getRepairMasteryMaxBonus()) / 100D); } // SUPER REPAIR 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 b688691c6..6c6b8da6b 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/SmeltingCommand.java @@ -1,5 +1,6 @@ package com.gmail.nossr50.commands.skills; +import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.locale.LocaleLoader; diff --git a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java index 5669c572e..8bc15b0d9 100644 --- a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java +++ b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java @@ -368,7 +368,7 @@ public class AdvancedConfig extends ConfigValidated { } /* SMELTING */ - if (getBurnModifierMaxLevel() < 1) { + if (getMaxBonusLevel(SubSkillType.SMELTING_FUEL_EFFICIENCY) < 1) { reason.add(SKILLS + "." + SMELTING + "." + FUEL_EFFICIENCY + "." + MAX_BONUS_LEVEL + " should be at least 1!"); } @@ -690,7 +690,7 @@ public class AdvancedConfig extends ConfigValidated { public double getArcaneSalvageExtractPartialEnchantsChance(int rank) { return getDoubleValue(SKILLS, SALVAGE, ARCANE_SALVAGE, EXTRACT_PARTIAL_ENCHANT, RANK, String.valueOf(rank)); } /* SMELTING */ - public int getBurnModifierMaxLevel() { return getIntValue(SKILLS, SMELTING, FUEL_EFFICIENCY, MAX_BONUS_LEVEL); } + //public int getBurnModifierMaxLevel() { return getIntValue(SKILLS, SMELTING, FUEL_EFFICIENCY, MAX_BONUS_LEVEL); } public double getBurnTimeMultiplier() { return getDoubleValue(SKILLS, SMELTING, FUEL_EFFICIENCY, MULTIPLIER); } public double getFluxMiningChance() { return getDoubleValue(SKILLS, SMELTING, FLUX, MINING, CHANCE); }