From 29520dc95c4de321a5da6abb01a979ccc33239a9 Mon Sep 17 00:00:00 2001 From: GJ Date: Thu, 7 Mar 2013 08:53:13 -0500 Subject: [PATCH] Get the mcMMOPlayer outside of the loop so it doesn't have to be recreated every time. --- src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;