2013-03-01 00:52:01 -05:00
|
|
|
package com.gmail.nossr50.skills.smelting;
|
|
|
|
|
|
|
|
import org.bukkit.Material;
|
2013-10-31 13:25:06 -04:00
|
|
|
import org.bukkit.inventory.ItemStack;
|
2013-10-31 14:29:06 -04:00
|
|
|
import org.bukkit.material.MaterialData;
|
2013-03-01 00:52:01 -05:00
|
|
|
|
|
|
|
import com.gmail.nossr50.config.AdvancedConfig;
|
2013-08-23 10:16:22 +02:00
|
|
|
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
2013-03-01 00:52:01 -05:00
|
|
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
2013-10-31 13:25:06 -04:00
|
|
|
import com.gmail.nossr50.util.ModUtils;
|
2013-03-01 00:52:01 -05:00
|
|
|
|
|
|
|
public class Smelting {
|
|
|
|
// The order of the values is extremely important, a few methods depend on it to work properly
|
2013-10-01 08:57:21 -04:00
|
|
|
public enum Tier {
|
|
|
|
EIGHT(8),
|
|
|
|
SEVEN(7),
|
|
|
|
SIX(6),
|
|
|
|
FIVE(5),
|
|
|
|
FOUR(4),
|
|
|
|
THREE(3),
|
|
|
|
TWO(2),
|
|
|
|
ONE(1);
|
2013-03-01 00:52:01 -05:00
|
|
|
|
|
|
|
int numerical;
|
|
|
|
|
|
|
|
private Tier(int numerical) {
|
|
|
|
this.numerical = numerical;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int toNumerical() {
|
|
|
|
return numerical;
|
|
|
|
}
|
|
|
|
|
2013-10-01 08:57:21 -04:00
|
|
|
protected int getLevel() {
|
2013-10-01 17:01:11 +02:00
|
|
|
return AdvancedConfig.getInstance().getSmeltingRankLevel(this);
|
2013-10-01 08:57:21 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
protected int getVanillaXPBoostModifier() {
|
|
|
|
return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostMultiplier(this);
|
|
|
|
}
|
2013-03-01 00:52:01 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
public static int burnModifierMaxLevel = AdvancedConfig.getInstance().getBurnModifierMaxLevel();
|
|
|
|
public static double burnTimeMultiplier = AdvancedConfig.getInstance().getBurnTimeMultiplier();
|
|
|
|
|
|
|
|
public static int fluxMiningUnlockLevel = AdvancedConfig.getInstance().getFluxMiningUnlockLevel();
|
|
|
|
public static double fluxMiningChance = AdvancedConfig.getInstance().getFluxMiningChance();
|
|
|
|
|
2013-10-31 13:25:06 -04:00
|
|
|
protected static int getResourceXp(ItemStack smelting) {
|
2013-10-31 14:29:06 -04:00
|
|
|
MaterialData data = smelting.getData();
|
2013-10-31 13:25:06 -04:00
|
|
|
Material resourceType = smelting.getType();
|
2013-03-01 00:52:01 -05:00
|
|
|
|
2013-10-31 14:29:06 -04:00
|
|
|
return ModUtils.isCustomOre(data) ? ModUtils.getCustomBlock(data).getSmeltingXpGain() : ExperienceConfig.getInstance().getXp(SkillType.SMELTING, resourceType != Material.GLOWING_REDSTONE_ORE ? resourceType : Material.REDSTONE_ORE);
|
2013-03-01 00:52:01 -05:00
|
|
|
}
|
|
|
|
}
|