mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-04-04 10:46:23 +02: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)) {
|
while (PP.getSkillXpLevel(skillType) >= PP.getXpToLevel(skillType)) {
|
||||||
if ((skillType.getMaxLevel() >= PP.getSkillLevel(skillType) + 1) && (m.getPowerLevelCap() >= PP.getPowerLevel() + 1)) {
|
if ((skillType.getMaxLevel() >= PP.getSkillLevel(skillType) + 1) && (m.getPowerLevelCap() >= PP.getPowerLevel() + 1)) {
|
||||||
|
PP.removeXP(skillType, PP.getXpToLevel(skillType));
|
||||||
skillups++;
|
skillups++;
|
||||||
PP.skillUp(skillType, 1);
|
PP.skillUp(skillType, 1);
|
||||||
|
|
||||||
McMMOPlayerLevelUpEvent eventToFire = new McMMOPlayerLevelUpEvent(player, skillType);
|
McMMOPlayerLevelUpEvent eventToFire = new McMMOPlayerLevelUpEvent(player, skillType);
|
||||||
Bukkit.getPluginManager().callEvent(eventToFire);
|
Bukkit.getPluginManager().callEvent(eventToFire);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
PP.removeXP(skillType, PP.getXpToLevel(skillType));
|
PP.addLevels(skillType, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!LoadProperties.useMySQL) {
|
if (!LoadProperties.useMySQL) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user