Fuel Efficiency now uses a rank system, also fixed some bugs with it

This commit is contained in:
nossr50 2019-03-09 16:22:20 -08:00
parent 28b71804a2
commit 437fe29112
7 changed files with 37 additions and 21 deletions

View File

@ -8,6 +8,9 @@ Key:
- Removal - Removal
Version 2.1.14 Version 2.1.14
Fixed a bug where Fuel Efficiency was way too good
Fuel Efficiency now uses the rank system
Removed Fuel Efficiency config options in advanced.yml
Added Tropical Fish, Raw Cod, Raw Salmon to the list of foods that benefit from Fisherman's Diet Added Tropical Fish, Raw Cod, Raw Salmon to the list of foods that benefit from Fisherman's Diet
Fixed a display issue with Fisherman's Diet Fixed a display issue with Fisherman's Diet

View File

@ -4,6 +4,7 @@ import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.smelting.Smelting; import com.gmail.nossr50.skills.smelting.Smelting;
import com.gmail.nossr50.skills.smelting.SmeltingManager;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.TextComponentFactory; import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
@ -35,7 +36,7 @@ public class SmeltingCommand extends SkillCommand {
protected void dataCalculations(Player player, float skillValue) { protected void dataCalculations(Player player, float skillValue) {
// FUEL EFFICIENCY // FUEL EFFICIENCY
if (canFuelEfficiency) { if (canFuelEfficiency) {
burnTimeModifier = decimal.format(1 + ((skillValue / Smelting.burnModifierMaxLevel) * Smelting.burnTimeMultiplier)); burnTimeModifier = String.valueOf(UserManager.getPlayer(player).getSmeltingManager().getFuelEfficiencyMultiplier());
} }
// FLUX MINING // FLUX MINING

View File

@ -438,10 +438,6 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
reason.add("Skills.Smelting.FuelEfficiency.MaxBonusLevel should be at least 1!"); reason.add("Skills.Smelting.FuelEfficiency.MaxBonusLevel should be at least 1!");
} }
if (getBurnTimeMultiplier() < 1) {
reason.add("Skills.Smelting.FuelEfficiency.Multiplier should be at least 1!");
}
if (getMaxBonusLevel(SubSkillType.SMELTING_SECOND_SMELT) < 1) { if (getMaxBonusLevel(SubSkillType.SMELTING_SECOND_SMELT) < 1) {
reason.add("Skills.Smelting.SecondSmelt.MaxBonusLevel should be at least 1!"); reason.add("Skills.Smelting.SecondSmelt.MaxBonusLevel should be at least 1!");
} }
@ -939,8 +935,12 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
public double getArcaneSalvageExtractPartialEnchantsChance(int rank) { return config.getDouble("Skills.Salvage.ArcaneSalvage.ExtractPartialEnchant.Rank_" + rank); } public double getArcaneSalvageExtractPartialEnchantsChance(int rank) { return config.getDouble("Skills.Salvage.ArcaneSalvage.ExtractPartialEnchant.Rank_" + rank); }
/* SMELTING */ /* SMELTING */
public int getBurnModifierMaxLevel() { return config.getInt("Skills.Smelting.FuelEfficiency.MaxBonusLevel", 100); } public int getBurnModifierMaxLevel() {
public double getBurnTimeMultiplier() { return config.getDouble("Skills.Smelting.FuelEfficiency.Multiplier", 3.0D); } if(mcMMO.isRetroModeEnabled())
return config.getInt("Skills.Smelting.FuelEfficiency.RetroMode.MaxBonusLevel", 1000);
else
return config.getInt("Skills.Smelting.FuelEfficiency.Standard.MaxBonusLevel", 100);
}
/*public int getFluxMiningUnlockLevel() { return config.getInt("Skills.Smelting.FluxMining.UnlockLevel", 250); }*/ /*public int getFluxMiningUnlockLevel() { return config.getInt("Skills.Smelting.FluxMining.UnlockLevel", 250); }*/
public double getFluxMiningChance() { return config.getDouble("Skills.Smelting.FluxMining.Chance", 33.0D); } public double getFluxMiningChance() { return config.getDouble("Skills.Smelting.FluxMining.Chance", 33.0D); }

View File

@ -52,6 +52,7 @@ public enum SubSkillType {
MINING_DEMOLITIONS_EXPERTISE(1), MINING_DEMOLITIONS_EXPERTISE(1),
MINING_DOUBLE_DROPS, MINING_DOUBLE_DROPS,
MINING_SUPER_BREAKER(1), MINING_SUPER_BREAKER(1),
MINING_FUEL_EFFICIENCY(4),
/* Repair */ /* Repair */
REPAIR_ARCANE_FORGING(8), REPAIR_ARCANE_FORGING(8),

View File

@ -102,9 +102,22 @@ public class SmeltingManager extends SkillManager {
* @param burnTime The initial burn time from the {@link FurnaceBurnEvent} * @param burnTime The initial burn time from the {@link FurnaceBurnEvent}
*/ */
public int fuelEfficiency(int burnTime) { public int fuelEfficiency(int burnTime) {
double burnModifier = 1 + (((double) getSkillLevel() / Smelting.burnModifierMaxLevel) * Smelting.burnTimeMultiplier); return burnTime * getFuelEfficiencyMultiplier();
}
return (int) (burnTime * burnModifier); public int getFuelEfficiencyMultiplier()
{
switch(RankUtils.getRank(getPlayer(), SubSkillType.SMELTING_FUEL_EFFICIENCY))
{
case 1:
return 2;
case 2:
return 3;
case 3:
return 4;
default:
return 1;
}
} }
public ItemStack smeltProcessing(ItemStack smelting, ItemStack result) { public ItemStack smeltProcessing(ItemStack smelting, ItemStack result) {

View File

@ -409,14 +409,6 @@ Skills:
# Settings for Smelting # Settings for Smelting
### ###
Smelting: Smelting:
FuelEfficiency:
# Multiplier: The furnace burn time will be multiplied by this value.
# MaxBonusLevel: On this level, the efficiency multiplier will stop increasing
Multiplier: 3.0
MaxBonusLevel:
Standard: 100
RetroMode: 1000
SecondSmelt: SecondSmelt:
# ChanceMax: Maximum chance of triggering Second Smelt # ChanceMax: Maximum chance of triggering Second Smelt
# MaxBonusLevel: On this level, the chance to cause Second Smelt will be <ChanceMax> # MaxBonusLevel: On this level, the chance to cause Second Smelt will be <ChanceMax>

View File

@ -207,11 +207,17 @@ Taming:
RetroMode: RetroMode:
Rank_1: 750 Rank_1: 750
Smelting: Smelting:
FluxMining: FuelEfficiency:
Standard: Standard:
Rank_1: 25 Rank_1: 10
Retro: Rank_2: 50
Rank_1: 250 Rank_3: 75
Rank_4: 100
RetroMode:
Rank_1: 100
Rank_2: 500
Rank_3: 750
Rank_4: 1000
UnderstandingTheArt: UnderstandingTheArt:
Standard: Standard:
Rank_1: 10 Rank_1: 10