mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
ACTUALLY made a power level cap.
This commit is contained in:
parent
b84a03082e
commit
24a50346db
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user