From d63702b300dcb1f907edaee82655c70bac81910e Mon Sep 17 00:00:00 2001 From: Aikar 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..4fafb4977 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 @@ -160,6 +161,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