aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAikar <[email protected]>2019-03-24 18:09:51 -0400
committerAikar <[email protected]>2019-03-24 18:09:51 -0400
commit745476f4dadbbc7b567307271be859dc7bd3cbba (patch)
treeeb439b528c3716c07b14937278300836054338e1
parentf81358ab8c51ac29873b63c7a2ea78098464283d (diff)
downloadPaper-745476f4dadbbc7b567307271be859dc7bd3cbba.tar.gz
Paper-745476f4dadbbc7b567307271be859dc7bd3cbba.zip
don't go below 0 for pickupDelay, breaks picking up items
vanilla checks for == 0 Fixes #1911
-rw-r--r--Spigot-Server-Patches/0380-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/Spigot-Server-Patches/0380-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch b/Spigot-Server-Patches/0380-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch
new file mode 100644
index 0000000000..a0b37e16e1
--- /dev/null
+++ b/Spigot-Server-Patches/0380-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch
@@ -0,0 +1,22 @@
+From e6a5d8a54a604baab979eb2219656538a43aa72c Mon Sep 17 00:00:00 2001
+From: Aikar <[email protected]>
+Date: Sun, 24 Mar 2019 18:08:36 -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 099bc7551..2c99cc2f1 100644
+--- a/src/main/java/net/minecraft/server/EntityItem.java
++++ b/src/main/java/net/minecraft/server/EntityItem.java
+@@ -72,6 +72,7 @@ public class EntityItem extends Entity implements HopperPusher {
+ // 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
+--
+2.21.0
+