mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-01 16:19:53 +01:00
Get the mcMMOPlayer outside of the loop so it doesn't have to be
recreated every time.
This commit is contained in:
parent
d40d89f29a
commit
29520dc95c
@ -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;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user