diff --git a/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java b/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java index 620a03094..9e370d820 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java @@ -217,9 +217,10 @@ public class SkillUtils { int xpRemoved = 0; if (profile.getSkillXpLevel(skillType) >= profile.getXpToLevel(skillType)) { + McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); while (profile.getSkillXpLevel(skillType) >= profile.getXpToLevel(skillType)) { - if ((skillType.getMaxLevel() >= profile.getSkillLevel(skillType) + 1) && (Config.getInstance().getPowerLevelCap() >= UserManager.getPlayer(player).getPowerLevel() + 1)) { + if ((skillType.getMaxLevel() >= profile.getSkillLevel(skillType) + 1) && (Config.getInstance().getPowerLevelCap() >= mcMMOPlayer.getPowerLevel() + 1)) { int xp = profile.getXpToLevel(skillType); xpRemoved += xp;