2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
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
|
2023-07-04 10:22:56 +02:00
|
|
|
index 91eba1c571764c88489ea2598fb9b4736554d5cc..fda34d93a5b75919c840d3bc0efa0651e5eb4843 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
2023-07-04 10:22:56 +02:00
|
|
|
@@ -122,6 +122,7 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
2021-06-11 14:02:28 +02:00
|
|
|
// 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
|
2023-07-04 10:22:56 +02:00
|
|
|
@@ -208,6 +209,7 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
2021-06-11 14:02:28 +02:00
|
|
|
// 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
|