mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-04 14:12:20 -07:00
Fix player death kept items not being in same slot (#6663)
This commit is contained in:
@@ -59,9 +59,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
public void die(DamageSource source) {
|
public void die(DamageSource source) {
|
||||||
boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES);
|
boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES);
|
||||||
@@ -0,0 +0,0 @@ public class ServerPlayer extends Player {
|
@@ -0,0 +0,0 @@ public class ServerPlayer extends Player {
|
||||||
|
this.dropExperience();
|
||||||
// we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory.
|
// we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory.
|
||||||
if (!event.getKeepInventory()) {
|
if (!event.getKeepInventory()) {
|
||||||
this.getInventory().clearContent();
|
- this.getInventory().clearContent();
|
||||||
+ // Paper start - replace logic
|
+ // Paper start - replace logic
|
||||||
+ for (NonNullList<ItemStack> inv : this.getInventory().compartments) {
|
+ for (NonNullList<ItemStack> inv : this.getInventory().compartments) {
|
||||||
+ processKeep(event, inv);
|
+ processKeep(event, inv);
|
||||||
|
@@ -16,4 +16,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ if (event.shouldDropExperience()) this.dropExperience(); // Paper - tie to event
|
+ if (event.shouldDropExperience()) this.dropExperience(); // 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.
|
// we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory.
|
||||||
if (!event.getKeepInventory()) {
|
if (!event.getKeepInventory()) {
|
||||||
this.getInventory().clearContent();
|
// Paper start - replace logic
|
||||||
|
Reference in New Issue
Block a user