mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Fuel Efficiency now uses a rank system, also fixed some bugs with it
This commit is contained in:
parent
28b71804a2
commit
437fe29112
@ -8,6 +8,9 @@ Key:
|
||||
- Removal
|
||||
|
||||
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
|
||||
Fixed a display issue with Fisherman's Diet
|
||||
|
||||
|
@ -4,6 +4,7 @@ import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
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.TextComponentFactory;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
@ -35,7 +36,7 @@ public class SmeltingCommand extends SkillCommand {
|
||||
protected void dataCalculations(Player player, float skillValue) {
|
||||
// FUEL EFFICIENCY
|
||||
if (canFuelEfficiency) {
|
||||
burnTimeModifier = decimal.format(1 + ((skillValue / Smelting.burnModifierMaxLevel) * Smelting.burnTimeMultiplier));
|
||||
burnTimeModifier = String.valueOf(UserManager.getPlayer(player).getSmeltingManager().getFuelEfficiencyMultiplier());
|
||||
}
|
||||
|
||||
// FLUX MINING
|
||||
|
@ -438,10 +438,6 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
||||
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) {
|
||||
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); }
|
||||
|
||||
/* SMELTING */
|
||||
public int getBurnModifierMaxLevel() { return config.getInt("Skills.Smelting.FuelEfficiency.MaxBonusLevel", 100); }
|
||||
public double getBurnTimeMultiplier() { return config.getDouble("Skills.Smelting.FuelEfficiency.Multiplier", 3.0D); }
|
||||
public int getBurnModifierMaxLevel() {
|
||||
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 double getFluxMiningChance() { return config.getDouble("Skills.Smelting.FluxMining.Chance", 33.0D); }
|
||||
|
@ -52,6 +52,7 @@ public enum SubSkillType {
|
||||
MINING_DEMOLITIONS_EXPERTISE(1),
|
||||
MINING_DOUBLE_DROPS,
|
||||
MINING_SUPER_BREAKER(1),
|
||||
MINING_FUEL_EFFICIENCY(4),
|
||||
|
||||
/* Repair */
|
||||
REPAIR_ARCANE_FORGING(8),
|
||||
|
@ -102,9 +102,22 @@ public class SmeltingManager extends SkillManager {
|
||||
* @param burnTime The initial burn time from the {@link FurnaceBurnEvent}
|
||||
*/
|
||||
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) {
|
||||
|
@ -409,14 +409,6 @@ Skills:
|
||||
# Settings for 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:
|
||||
# ChanceMax: Maximum chance of triggering Second Smelt
|
||||
# MaxBonusLevel: On this level, the chance to cause Second Smelt will be <ChanceMax>
|
||||
|
@ -207,11 +207,17 @@ Taming:
|
||||
RetroMode:
|
||||
Rank_1: 750
|
||||
Smelting:
|
||||
FluxMining:
|
||||
FuelEfficiency:
|
||||
Standard:
|
||||
Rank_1: 25
|
||||
Retro:
|
||||
Rank_1: 250
|
||||
Rank_1: 10
|
||||
Rank_2: 50
|
||||
Rank_3: 75
|
||||
Rank_4: 100
|
||||
RetroMode:
|
||||
Rank_1: 100
|
||||
Rank_2: 500
|
||||
Rank_3: 750
|
||||
Rank_4: 1000
|
||||
UnderstandingTheArt:
|
||||
Standard:
|
||||
Rank_1: 10
|
||||
|
Loading…
Reference in New Issue
Block a user