Commits

md_5 authored bf43ca62a65
SPIGOT-1816: Rework drop capture.
No tags

nms-patches/Entity.patch

Modified
357 357 + // CraftBukkit end
358 358 +
359 359 } catch (Throwable throwable) {
360 360 CrashReport crashreport = CrashReport.a(throwable, "Loading entity NBT");
361 361 CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded");
362 362 @@ -1302,6 +1522,12 @@
363 363
364 364 public EntityItem a(ItemStack itemstack, float f) {
365 365 if (itemstack.count != 0 && itemstack.getItem() != null) {
366 366 + // CraftBukkit start - Capture drops for death event
367 -+ if (this instanceof EntityLiving && ((EntityLiving) this).drops != null) {
367 ++ if (this instanceof EntityLiving) {
368 368 + ((EntityLiving) this).drops.add(org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(itemstack));
369 369 + return null;
370 370 + }
371 371 + // CraftBukkit end
372 372 EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY + (double) f, this.locZ, itemstack);
373 373
374 374 entityitem.q();
375 375 @@ -1422,6 +1648,22 @@
376 376 if (entity.by() != this) {
377 377 throw new IllegalStateException("Use x.startRiding(y), not y.addPassenger(x)");

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut