Get the mcMMOPlayer outside of the loop so it doesn't have to be

recreated every time.
This commit is contained in:
GJ 2013-03-07 08:53:13 -05:00
parent d40d89f29a
commit 29520dc95c

View File

@ -217,9 +217,10 @@ public class SkillUtils {
int xpRemoved = 0; int xpRemoved = 0;
if (profile.getSkillXpLevel(skillType) >= profile.getXpToLevel(skillType)) { if (profile.getSkillXpLevel(skillType) >= profile.getXpToLevel(skillType)) {
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
while (profile.getSkillXpLevel(skillType) >= profile.getXpToLevel(skillType)) { 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); int xp = profile.getXpToLevel(skillType);
xpRemoved += xp; xpRemoved += xp;