diff --git a/nms-patches/EntityArrow.patch b/nms-patches/EntityArrow.patch index 656ebe0aeb..8da69dc294 100644 --- a/nms-patches/EntityArrow.patch +++ b/nms-patches/EntityArrow.patch @@ -46,15 +46,14 @@ } if (entity.damageEntity(damagesource, (float) i)) { -@@ -422,6 +436,20 @@ +@@ -422,9 +436,22 @@ public void d(EntityHuman entityhuman) { if (!this.world.isClientSide && this.inGround && this.shake <= 0) { + // CraftBukkit start -+ ItemStack itemstack = new ItemStack(Items.ARROW); ++ ItemStack itemstack = this.j(); // PAIL: rename ++ EntityItem item = new EntityItem(this.world, this.locX, this.locY, this.locZ, itemstack); + if (this.fromPlayer == PickupStatus.ALLOWED && entityhuman.inventory.canHold(itemstack) > 0) { -+ EntityItem item = new EntityItem(this.world, this.locX, this.locY, this.locZ, itemstack); -+ + PlayerPickupArrowEvent event = new PlayerPickupArrowEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), new org.bukkit.craftbukkit.entity.CraftItem(this.world.getServer(), this, item), (org.bukkit.entity.Arrow) this.getBukkitEntity()); + // event.setCancelled(!entityhuman.canPickUpLoot); TODO + this.world.getServer().getPluginManager().callEvent(event); @@ -63,11 +62,15 @@ + return; + } + } -+ // CraftBukkit end boolean flag = this.fromPlayer == EntityArrow.PickupStatus.ALLOWED || this.fromPlayer == EntityArrow.PickupStatus.CREATIVE_ONLY && entityhuman.abilities.canInstantlyBuild; - if (this.fromPlayer == EntityArrow.PickupStatus.ALLOWED && !entityhuman.inventory.pickup(this.j())) { -@@ -493,7 +521,14 @@ +- if (this.fromPlayer == EntityArrow.PickupStatus.ALLOWED && !entityhuman.inventory.pickup(this.j())) { ++ if (this.fromPlayer == EntityArrow.PickupStatus.ALLOWED && !entityhuman.inventory.pickup(item.getItemStack())) { ++ // CraftBukkit end + flag = false; + } + +@@ -493,7 +520,14 @@ } if (EnchantmentManager.a(Enchantments.ARROW_FIRE, entityliving) > 0) {