diff --git a/src/main/java/com/gmail/nossr50/m.java b/src/main/java/com/gmail/nossr50/m.java index ca7d2c948..1bdcccb54 100644 --- a/src/main/java/com/gmail/nossr50/m.java +++ b/src/main/java/com/gmail/nossr50/m.java @@ -11,6 +11,7 @@ import org.bukkit.entity.Player; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.config.LoadProperties; import com.gmail.nossr50.events.fake.FakeBlockBreakEvent; import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent; import com.gmail.nossr50.events.items.McMMOItemSpawnEvent; @@ -259,4 +260,13 @@ public class m { return skillLevel; } } + + public static int getPowerLevelCap() { + if (LoadProperties.powerLevelCap > 0) { + return LoadProperties.powerLevelCap; + } + else { + return Integer.MAX_VALUE; + } + } } diff --git a/src/main/java/com/gmail/nossr50/skills/Skills.java b/src/main/java/com/gmail/nossr50/skills/Skills.java index fefb7dd3a..91a5a21c1 100644 --- a/src/main/java/com/gmail/nossr50/skills/Skills.java +++ b/src/main/java/com/gmail/nossr50/skills/Skills.java @@ -195,7 +195,7 @@ public class Skills { if (PP.getSkillXpLevel(skillType) >= PP.getXpToLevel(skillType)) { while (PP.getSkillXpLevel(skillType) >= PP.getXpToLevel(skillType)) { - if ((skillType.getMaxLevel() >= PP.getSkillLevel(skillType) + 1) && (LoadProperties.powerLevelCap >= PP.getPowerLevel() + 1)) { + if ((skillType.getMaxLevel() >= PP.getSkillLevel(skillType) + 1) && (m.getPowerLevelCap() >= PP.getPowerLevel() + 1)) { skillups++; PP.addLevels(skillType, 1);