diff options
-rw-r--r-- | Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java | 10 |
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) { |