SPIGOT-7806: Handle both loot and inventory item drop behaviour in PlayerDeathEvent
By: Doc <nachito94@msn.com>
This commit is contained in:
@@ -924,7 +924,13 @@ public class CraftEventFactory {
|
||||
for (org.bukkit.inventory.ItemStack stack : event.getDrops()) {
|
||||
if (stack == null || stack.getType() == Material.AIR) continue;
|
||||
|
||||
victim.drop(CraftItemStack.asNMSCopy(stack), true, false, false); // SPIGOT-7800, SPIGOT-7801: Vanilla Behaviour for dropped items
|
||||
if (stack instanceof CraftItemStack craftItemStack && craftItemStack.isForInventoryDrop()) {
|
||||
victim.drop(CraftItemStack.asNMSCopy(stack), true, false, false); // SPIGOT-7800, SPIGOT-7801: Vanilla Behaviour for Player Inventory dropped items
|
||||
} else {
|
||||
victim.forceDrops = true;
|
||||
victim.spawnAtLocation(CraftItemStack.asNMSCopy(stack)); // SPIGOT-7806: Vanilla Behaviour for items not related to Player Inventory dropped items
|
||||
victim.forceDrops = false;
|
||||
}
|
||||
}
|
||||
|
||||
return event;
|
||||
|
||||
Reference in New Issue
Block a user