Don't set negative xp values

This commit is contained in:
TfT_02 2013-05-04 10:51:47 +02:00
parent 5e3383dbf4
commit 44770cf13b

View File

@ -60,7 +60,12 @@ public class SelfListener implements Listener {
// System.out.println("Adjusted XP " + (event.getRawXpGained() - (event.getRawXpGained() * difference)));
float newValue = event.getRawXpGained() - (event.getRawXpGained() * difference);
event.setRawXpGained(newValue);
if (newValue > 0) {
event.setRawXpGained(newValue);
}
else {
event.setCancelled(true);
}
}
mcMMOPlayer.getProfile().registeredXpGain(skillType, event.getRawXpGained());