mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-02 05:34:44 +02:00
All skills should be on the new rank system now
This commit is contained in:
@ -3,44 +3,23 @@ package com.gmail.nossr50.skills.smelting;
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.util.skills.RankUtils;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class Smelting {
|
||||
// The order of the values is extremely important, a few methods depend on it to work properly
|
||||
public enum Tier {
|
||||
EIGHT(8),
|
||||
SEVEN(7),
|
||||
SIX(6),
|
||||
FIVE(5),
|
||||
FOUR(4),
|
||||
THREE(3),
|
||||
TWO(2),
|
||||
ONE(1);
|
||||
|
||||
int numerical;
|
||||
|
||||
Tier(int numerical) {
|
||||
this.numerical = numerical;
|
||||
}
|
||||
|
||||
public int toNumerical() {
|
||||
return numerical;
|
||||
}
|
||||
|
||||
protected int getLevel() {
|
||||
return AdvancedConfig.getInstance().getSmeltingRankLevel(this);
|
||||
}
|
||||
|
||||
protected int getVanillaXPBoostModifier() {
|
||||
return AdvancedConfig.getInstance().getSmeltingVanillaXPBoostMultiplier(this);
|
||||
}
|
||||
public static int getRank(Player player)
|
||||
{
|
||||
return RankUtils.getRank(player, SubSkillType.SMELTING_UNDERSTANDING_THE_ART);
|
||||
}
|
||||
|
||||
public static int burnModifierMaxLevel = AdvancedConfig.getInstance().getBurnModifierMaxLevel();
|
||||
public static double burnTimeMultiplier = AdvancedConfig.getInstance().getBurnTimeMultiplier();
|
||||
|
||||
public static int fluxMiningUnlockLevel = AdvancedConfig.getInstance().getFluxMiningUnlockLevel();
|
||||
public static int fluxMiningUnlockLevel = RankUtils.getUnlockLevel(SubSkillType.SMELTING_FLUX_MINING);
|
||||
public static double fluxMiningChance = AdvancedConfig.getInstance().getFluxMiningChance();
|
||||
|
||||
protected static int getResourceXp(ItemStack smelting) {
|
||||
|
@ -10,12 +10,12 @@ import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.skills.SkillManager;
|
||||
import com.gmail.nossr50.skills.mining.Mining;
|
||||
import com.gmail.nossr50.skills.smelting.Smelting.Tier;
|
||||
import com.gmail.nossr50.util.BlockUtils;
|
||||
import com.gmail.nossr50.util.EventUtils;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.skills.ParticleEffectUtils;
|
||||
import com.gmail.nossr50.util.skills.RankUtils;
|
||||
import com.gmail.nossr50.util.skills.SkillActivationType;
|
||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||
import com.gmail.nossr50.util.sounds.SoundManager;
|
||||
@ -75,7 +75,7 @@ public class SmeltingManager extends SkillManager {
|
||||
if (item == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (!EventUtils.simulateBlockBreak(blockState.getBlock(), player, true)) {
|
||||
return false;
|
||||
}
|
||||
@ -154,14 +154,6 @@ public class SmeltingManager extends SkillManager {
|
||||
* @return the vanilla XP multiplier
|
||||
*/
|
||||
public int getVanillaXpMultiplier() {
|
||||
int skillLevel = getSkillLevel();
|
||||
|
||||
for (Tier tier : Tier.values()) {
|
||||
if (skillLevel >= tier.getLevel()) {
|
||||
return tier.getVanillaXPBoostModifier();
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
return RankUtils.getRank(getPlayer(), SubSkillType.SMELTING_UNDERSTANDING_THE_ART);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user