summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIaccidentally <coryhuckaby@gmail.com>2012-06-24 23:27:30 -0400
committerIaccidentally <coryhuckaby@gmail.com>2012-06-24 23:27:30 -0400
commit3b2523575592da4aa07e3389d81fc10e42ff141e (patch)
tree56815be3f52b41865ee6c66fe5ca7c3917bf1f45
parent4d17b73291a35766f77fe803d2ed437c7a1a5833 (diff)
downloadEssentials-3b2523575592da4aa07e3389d81fc10e42ff141e.tar
Essentials-3b2523575592da4aa07e3389d81fc10e42ff141e.tar.gz
Essentials-3b2523575592da4aa07e3389d81fc10e42ff141e.tar.lz
Essentials-3b2523575592da4aa07e3389d81fc10e42ff141e.tar.xz
Essentials-3b2523575592da4aa07e3389d81fc10e42ff141e.zip
add essentials.keepxp to allow a player to keep their level after death.
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java
index 19cfde0f4..82745780d 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java
@@ -118,7 +118,15 @@ public class EssentialsEntityListener implements Listener
event.setDeathMessage("");
}
}
-
+ @EventHandler(priority = EventPriority.LOW)
+ public void onPlayerDeathExpEvent(final PlayerDeathEvent event)
+ {
+ final User user = ess.getUser(event.getEntity());
+ if (user.isAuthorized("essentials.keepxp"))
+ {
+ event.setKeepLevel(true);
+ }
+ }
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onFoodLevelChange(final FoodLevelChangeEvent event)
{