mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-01 08:20:51 +01:00
1e7dd72f15
The game uses 0.95d now
28 lines
1.7 KiB
Diff
28 lines
1.7 KiB
Diff
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
|
|
index 18c9c7c2b0605bee2936fbb084108dd9791f7ebe..314ba941c72a50b479cb634f3337ded3e63a7622 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
|
@@ -140,6 +140,7 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
|
// 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
|
|
@@ -226,6 +227,7 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
|
// 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
|