Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 12:30:06 +01:00
41647af74c
We cannot put blocking network I/O onto the worldgen threads, this will crash the server if it stalls
28 Zeilen
1.6 KiB
Diff
28 Zeilen
1.6 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 a0b27bdeabcabd0bd07b1b495105f9b6af998092..23506fd3a98c240606a00e29624012ae3bbab21a 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
|
@@ -116,6 +116,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
|
|
@@ -202,6 +203,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
|