[ci skip] Add more identifying patch comments

This commit is contained in:
Nassim Jahnke
2024-01-21 13:56:22 +01:00
parent 0571a6438e
commit db4ed47134
55 changed files with 211 additions and 236 deletions

View File

@@ -18,7 +18,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
});
}
+ // Paper start - process inventory
+ // Paper start - PlayerDeathEvent#getItemsToKeep
+ private static void processKeep(org.bukkit.event.entity.PlayerDeathEvent event, NonNullList<ItemStack> inv) {
+ List<org.bukkit.inventory.ItemStack> itemsToKeep = event.getItemsToKeep();
+ if (inv == null) {
@@ -56,7 +56,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ }
+ }
+ // Paper end
+ // Paper end - PlayerDeathEvent#getItemsToKeep
+
@Override
public void die(DamageSource damageSource) {
@@ -66,12 +66,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory.
if (!event.getKeepInventory()) {
- this.getInventory().clearContent();
+ // Paper start - replace logic
+ // Paper start - PlayerDeathEvent#getItemsToKeep
+ for (NonNullList<ItemStack> inv : this.getInventory().compartments) {
+ processKeep(event, inv);
+ }
+ processKeep(event, null);
+ // Paper end
+ // Paper end - PlayerDeathEvent#getItemsToKeep
}
this.setCamera(this); // Remove spectated target