adds a permission node that keeps a player's inventory on death (#2531) @minksuki

Closes #2524.

Adds a permission node, `essentials.keepinv` so on player death their inventory will not be wiped.
This commit is contained in:
minksuki 2019-05-15 02:59:48 -04:00 committed by md678685
parent d107d00ac3
commit a1297feb9d

View File

@ -159,6 +159,14 @@ public class EssentialsEntityListener implements Listener {
}
}
@EventHandler(priority = EventPriority.LOW)
public void onPlayerDeathInvEvent(final PlayerDeathEvent event) {
final User user = ess.getUser(event.getEntity());
if (user.isAuthorized("essentials.keepinv")) {
event.setKeepInventory(true);
}
}
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onFoodLevelChange(final FoodLevelChangeEvent event) {
if (event.getEntity() instanceof Player) {