From 44770cf13bb0337f68f60838d117030501003e77 Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Sat, 4 May 2013 10:51:47 +0200 Subject: [PATCH] Don't set negative xp values --- .../java/com/gmail/nossr50/listeners/SelfListener.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/SelfListener.java b/src/main/java/com/gmail/nossr50/listeners/SelfListener.java index 4905e7110..63752ed25 100644 --- a/src/main/java/com/gmail/nossr50/listeners/SelfListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/SelfListener.java @@ -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());