From 3d3333ff2362090db8455b5d5f464b3660c457b0 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <BillyGalbreath@users.noreply.github.com>
Date: Fri, 7 Sep 2018 19:03:38 -0500
Subject: [PATCH] Fix #1420 (#1421)

---
 Spigot-Server-Patches/Fix-1420.patch | 31 ++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 Spigot-Server-Patches/Fix-1420.patch

diff --git a/Spigot-Server-Patches/Fix-1420.patch b/Spigot-Server-Patches/Fix-1420.patch
new file mode 100644
index 0000000000..c90906acf6
--- /dev/null
+++ b/Spigot-Server-Patches/Fix-1420.patch
@@ -0,0 +1,31 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: BillyGalbreath <Blake.Galbreath@GMail.com>
+Date: Fri, 7 Sep 2018 18:28:24 -0500
+Subject: [PATCH] Fix #1420
+
+
+diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java
+index 187f02d4e..fcb1cb36a 100644
+--- a/src/main/java/net/minecraft/server/EntityArrow.java
++++ b/src/main/java/net/minecraft/server/EntityArrow.java
+@@ -0,0 +0,0 @@ public abstract class EntityArrow extends Entity implements IProjectile {
+         if (!this.world.isClientSide && (this.inGround || this.q()) && this.shake <= 0) {
+             // CraftBukkit start
+             ItemStack itemstack = this.getItemStack();
++            if (!itemstack.isEmpty()) { // Paper - GH-1420 (skip pick up event for fully damaged (or air) itemstack)
+             EntityItem item = new EntityItem(this.world, this.locX, this.locY, this.locZ, itemstack);
+             if (this.fromPlayer == PickupStatus.ALLOWED && entityhuman.inventory.canHold(itemstack) > 0) {
+                 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());
+@@ -0,0 +0,0 @@ public abstract class EntityArrow extends Entity implements IProjectile {
+                     return;
+                 }
+             }
++            } // Paper - GH-1420
+             boolean flag = this.fromPlayer == EntityArrow.PickupStatus.ALLOWED || this.fromPlayer == EntityArrow.PickupStatus.CREATIVE_ONLY && entityhuman.abilities.canInstantlyBuild || this.q() && this.getShooter().getUniqueID() == entityhuman.getUniqueID();
+ 
+-            if (this.fromPlayer == EntityArrow.PickupStatus.ALLOWED && !entityhuman.inventory.pickup(item.getItemStack())) {
++            if (this.fromPlayer == EntityArrow.PickupStatus.ALLOWED && !entityhuman.inventory.pickup(itemstack)) { // Paper - GH-1420
+                 // CraftBukkit end
+                 flag = false;
+             }
+--
\ No newline at end of file