mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 15:16: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;
|
import com.gmail.nossr50.util.spout.SpoutUtils;
|
||||||
|
|
||||||
public class SkillUtils {
|
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) {
|
public static int handleFoodSkills(Player player, SkillType skill, int eventFoodLevel, int baseLevel, int maxLevel, int rankChange) {
|
||||||
int skillLevel = UserManager.getPlayer(player).getProfile().getSkillLevel(skill);
|
int skillLevel = UserManager.getPlayer(player).getProfile().getSkillLevel(skill);
|
||||||
@ -425,7 +424,7 @@ public class SkillUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
itemLore.add("mcMMO Ability Tool");
|
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);
|
itemMeta.setLore(itemLore);
|
||||||
heldItem.setItemMeta(itemMeta);
|
heldItem.setItemMeta(itemMeta);
|
||||||
@ -491,11 +490,11 @@ public class SkillUtils {
|
|||||||
if (itemLore.remove("mcMMO Ability Tool")) {
|
if (itemLore.remove("mcMMO Ability Tool")) {
|
||||||
int efficiencyLevel = item.getEnchantmentLevel(Enchantment.DIG_SPEED);
|
int efficiencyLevel = item.getEnchantmentLevel(Enchantment.DIG_SPEED);
|
||||||
|
|
||||||
if (efficiencyLevel <= enchantBuff) {
|
if (efficiencyLevel <= AdvancedConfig.getInstance().getEnchantBuff()) {
|
||||||
itemMeta.removeEnchant(Enchantment.DIG_SPEED);
|
itemMeta.removeEnchant(Enchantment.DIG_SPEED);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
itemMeta.addEnchant(Enchantment.DIG_SPEED, efficiencyLevel - enchantBuff, true);
|
itemMeta.addEnchant(Enchantment.DIG_SPEED, efficiencyLevel - AdvancedConfig.getInstance().getEnchantBuff(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
itemMeta.setLore(itemLore);
|
itemMeta.setLore(itemLore);
|
||||||
|
Loading…
Reference in New Issue
Block a user