diff options
Diffstat (limited to 'patches/server/0310-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch')
-rw-r--r-- | patches/server/0310-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/patches/server/0310-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch b/patches/server/0310-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch new file mode 100644 index 0000000000..94aa72db11 --- /dev/null +++ b/patches/server/0310-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch @@ -0,0 +1,27 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar <[email protected]> +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/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +index 6ecab1dd5932c4c346cde987cb9463b00a32d385..95dc82a0a9bd8a3fa9c704696e7b3dc48bf4d6a0 100644 +--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java ++++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +@@ -114,6 +114,7 @@ public class ItemEntity 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 +@@ -200,6 +201,7 @@ public class ItemEntity 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 |