mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Fixed issue with negative XP on level up.
This commit is contained in:
parent
ea7d1ce0e2
commit
e3e2def809
@ -188,14 +188,16 @@ public class Skills {
|
||||
|
||||
while (PP.getSkillXpLevel(skillType) >= PP.getXpToLevel(skillType)) {
|
||||
if ((skillType.getMaxLevel() >= PP.getSkillLevel(skillType) + 1) && (m.getPowerLevelCap() >= PP.getPowerLevel() + 1)) {
|
||||
PP.removeXP(skillType, PP.getXpToLevel(skillType));
|
||||
skillups++;
|
||||
PP.skillUp(skillType, 1);
|
||||
|
||||
McMMOPlayerLevelUpEvent eventToFire = new McMMOPlayerLevelUpEvent(player, skillType);
|
||||
Bukkit.getPluginManager().callEvent(eventToFire);
|
||||
}
|
||||
|
||||
PP.removeXP(skillType, PP.getXpToLevel(skillType));
|
||||
else {
|
||||
PP.addLevels(skillType, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (!LoadProperties.useMySQL) {
|
||||
|
Loading…
Reference in New Issue
Block a user