PlayerDeathEvent#shouldDropExperience

This commit is contained in:
Shane Freeder 2019-12-24 00:35:42 +00:00
parent cd2f06bbc2
commit 0664232c53

View file

@ -615,7 +615,7 @@
- if (!this.isSpectator()) {
- this.dropAllDeathLoot(this.serverLevel(), damageSource);
+ // SPIGOT-5478 must be called manually now
+ this.dropExperience(this.serverLevel(), damageSource.getEntity());
+ if (event.shouldDropExperience()) this.dropExperience(this.serverLevel(), damageSource.getEntity()); // Paper - tie to event
+ // we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory.
+ if (!event.getKeepInventory()) {
+ // Paper start - PlayerDeathEvent#getItemsToKeep