mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-18 08:35:44 +01:00
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:
parent
d107d00ac3
commit
a1297feb9d
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user