1
0
mirror of https://github.com/mcMMO-Dev/mcMMO.git synced 2025-03-16 14:59:44 +01:00

61 lines
3.0 KiB
Java
Raw Normal View History

2013-01-23 16:34:01 -05:00
package com.gmail.nossr50.skills.smelting;
import org.bukkit.Material;
import com.gmail.nossr50.config.AdvancedConfig;
2013-02-27 18:28:20 -05:00
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.skills.utilities.SkillType;
2013-01-23 16:34:01 -05:00
public class Smelting {
2013-02-27 18:28:20 -05:00
// The order of the values is extremely important, a few methods depend on it to work properly
protected enum Tier {
FIVE(5) {
@Override public int getLevel() {return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank5Level();}
@Override public int getVanillaXPBoostModifier() {return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank5Multiplier();}},
FOUR(4) {
@Override public int getLevel() {return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank4Level();}
@Override public int getVanillaXPBoostModifier() {return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank4Multiplier();}},
THREE(3) {
@Override public int getLevel() {return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank3Level();}
@Override public int getVanillaXPBoostModifier() {return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank3Multiplier();}},
TWO(2) {
@Override public int getLevel() {return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank2Level();}
@Override public int getVanillaXPBoostModifier() {return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank2Multiplier();}},
ONE(1) {
@Override public int getLevel() {return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank1Level();}
@Override public int getVanillaXPBoostModifier() {return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostRank1Multiplier();}};
int numerical;
private Tier(int numerical) {
this.numerical = numerical;
}
public int toNumerical() {
return numerical;
}
abstract protected int getLevel();
abstract protected int getVanillaXPBoostModifier();
}
public static int burnModifierMaxLevel = AdvancedConfig.getInstance().getBurnModifierMaxLevel();
public static double burnTimeMultiplier = AdvancedConfig.getInstance().getBurnTimeMultiplier();
public static double secondSmeltMaxChance = AdvancedConfig.getInstance().getSecondSmeltMaxChance();
public static int secondSmeltMaxLevel = AdvancedConfig.getInstance().getSecondSmeltMaxLevel();
2013-01-23 16:34:01 -05:00
public static int fluxMiningUnlockLevel = AdvancedConfig.getInstance().getFluxMiningUnlockLevel();
public static double fluxMiningChance = AdvancedConfig.getInstance().getFluxMiningChance();
2013-01-23 16:34:01 -05:00
2013-02-27 18:28:20 -05:00
protected static int getResourceXp(Material resourceType) {
int xp = Config.getInstance().getXp(SkillType.SMELTING, resourceType);
2013-02-27 18:28:20 -05:00
if (resourceType == Material.GLOWING_REDSTONE_ORE) {
xp = Config.getInstance().getXp(SkillType.SMELTING, Material.REDSTONE_ORE);
}
2013-02-27 18:28:20 -05:00
return xp;
}
2013-01-23 16:34:01 -05:00
}