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-09-23 04:06:03 +02:00
|
|
|
index 5744d726c4e7a970db5c1c3764d530d839d95597..2edc55f09b79ac75788a0ded8b3d2a6800674470 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
|