mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
Don't cache config options to prepare for eventual config reload support
This commit is contained in:
parent
bf96fb2214
commit
b416a59bb7
@ -43,7 +43,6 @@ import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.gmail.nossr50.util.spout.SpoutUtils;
|
||||
|
||||
public class SkillUtils {
|
||||
private static int enchantBuff = AdvancedConfig.getInstance().getEnchantBuff();
|
||||
|
||||
public static int handleFoodSkills(Player player, SkillType skill, int eventFoodLevel, int baseLevel, int maxLevel, int rankChange) {
|
||||
int skillLevel = UserManager.getPlayer(player).getProfile().getSkillLevel(skill);
|
||||
@ -425,7 +424,7 @@ public class SkillUtils {
|
||||
}
|
||||
|
||||
itemLore.add("mcMMO Ability Tool");
|
||||
itemMeta.addEnchant(Enchantment.DIG_SPEED, efficiencyLevel + enchantBuff, true);
|
||||
itemMeta.addEnchant(Enchantment.DIG_SPEED, efficiencyLevel + AdvancedConfig.getInstance().getEnchantBuff(), true);
|
||||
|
||||
itemMeta.setLore(itemLore);
|
||||
heldItem.setItemMeta(itemMeta);
|
||||
@ -491,11 +490,11 @@ public class SkillUtils {
|
||||
if (itemLore.remove("mcMMO Ability Tool")) {
|
||||
int efficiencyLevel = item.getEnchantmentLevel(Enchantment.DIG_SPEED);
|
||||
|
||||
if (efficiencyLevel <= enchantBuff) {
|
||||
if (efficiencyLevel <= AdvancedConfig.getInstance().getEnchantBuff()) {
|
||||
itemMeta.removeEnchant(Enchantment.DIG_SPEED);
|
||||
}
|
||||
else {
|
||||
itemMeta.addEnchant(Enchantment.DIG_SPEED, efficiencyLevel - enchantBuff, true);
|
||||
itemMeta.addEnchant(Enchantment.DIG_SPEED, efficiencyLevel - AdvancedConfig.getInstance().getEnchantBuff(), true);
|
||||
}
|
||||
|
||||
itemMeta.setLore(itemLore);
|
||||
|
Loading…
Reference in New Issue
Block a user