From 644e1d4f8f148586499d46987dad9507b7653e41 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 24 Mar 2019 18:12:56 -0400 Subject: [PATCH] don't go below 0 for pickupDelay, breaks picking up items vanilla checks for == 0 Fixes #1911 --- ...s-and-setters-for-EntityItem-owner-a.patch | 2 +- ...PlayerPickupItemEvent-setFlyAtPlayer.patch | 5 +++-- ...-for-pickupDelay-breaks-picking-up-i.patch | 20 +++++++++++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 Spigot-Server-Patches/don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch diff --git a/Spigot-Server-Patches/Implement-getters-and-setters-for-EntityItem-owner-a.patch b/Spigot-Server-Patches/Implement-getters-and-setters-for-EntityItem-owner-a.patch index 7342010088..d202aa0f84 100644 --- a/Spigot-Server-Patches/Implement-getters-and-setters-for-EntityItem-owner-a.patch +++ b/Spigot-Server-Patches/Implement-getters-and-setters-for-EntityItem-owner-a.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Implement getters and setters for EntityItem owner and diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index 6752d0b8c..03fee65e4 100644 +index c9473087a..e723bd339 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -0,0 +0,0 @@ public class EntityItem extends Entity { diff --git a/Spigot-Server-Patches/PlayerPickupItemEvent-setFlyAtPlayer.patch b/Spigot-Server-Patches/PlayerPickupItemEvent-setFlyAtPlayer.patch index 0e03922372..16900e6259 100644 --- a/Spigot-Server-Patches/PlayerPickupItemEvent-setFlyAtPlayer.patch +++ b/Spigot-Server-Patches/PlayerPickupItemEvent-setFlyAtPlayer.patch @@ -5,7 +5,7 @@ Subject: [PATCH] PlayerPickupItemEvent#setFlyAtPlayer diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index 39a804b7c..643793d55 100644 +index 39a804b7c..921a56c31 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -0,0 +0,0 @@ public class EntityItem extends Entity { @@ -31,9 +31,10 @@ index 39a804b7c..643793d55 100644 } @@ -0,0 +0,0 @@ public class EntityItem extends Entity { + // CraftBukkit end if (this.pickupDelay == 0 && (this.g == null || 6000 - this.age <= 200 || this.g.equals(entityhuman.getUniqueID())) && entityhuman.inventory.pickup(itemstack)) { - entityhuman.receive(this, i); +- entityhuman.receive(this, i); + // Paper Start + if (flyAtPlayer) { + entityhuman.receive(this, i); diff --git a/Spigot-Server-Patches/don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch b/Spigot-Server-Patches/don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch new file mode 100644 index 0000000000..f10445cca5 --- /dev/null +++ b/Spigot-Server-Patches/don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch @@ -0,0 +1,20 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Sun, 24 Mar 2019 18:09:20 -0400 +Subject: [PATCH] don't go below 0 for pickupDelay, breaks picking up items + +vanilla checks for == 0 + +diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java +index e723bd339..cf00d0c88 100644 +--- a/src/main/java/net/minecraft/server/EntityItem.java ++++ b/src/main/java/net/minecraft/server/EntityItem.java +@@ -0,0 +0,0 @@ public class EntityItem extends Entity { + // CraftBukkit start - Use wall time for pickup and despawn timers + int elapsedTicks = MinecraftServer.currentTick - this.lastTick; + if (this.pickupDelay != 32767) this.pickupDelay -= elapsedTicks; ++ this.pickupDelay = Math.max(0, this.pickupDelay); // Paper - don't go below 0 + if (this.age != -32768) this.age += elapsedTicks; + this.lastTick = MinecraftServer.currentTick; + // CraftBukkit end +-- \ No newline at end of file