SPIGOT-1816: Rework drop capture.

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2016-03-07 19:51:42 +11:00
parent 406b2d6204
commit ced78d5d27
6 changed files with 30 additions and 113 deletions

View File

@@ -364,7 +364,7 @@
public EntityItem a(ItemStack itemstack, float f) {
if (itemstack.count != 0 && itemstack.getItem() != null) {
+ // CraftBukkit start - Capture drops for death event
+ if (this instanceof EntityLiving && ((EntityLiving) this).drops != null) {
+ if (this instanceof EntityLiving) {
+ ((EntityLiving) this).drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(itemstack));
+ return null;
+ }