diff options
author | Aikar <[email protected]> | 2019-03-24 18:12:56 -0400 |
---|---|---|
committer | Aikar <[email protected]> | 2019-03-24 18:12:56 -0400 |
commit | 76fab035d3bfda66934fced90e8ba3456593ae6c (patch) | |
tree | 027498b089d63fa2803ed164a58af678e44aa9cf | |
parent | 424b05051bf3c9c789a6379e58ff3576459641fd (diff) | |
download | Paper-76fab035d3bfda66934fced90e8ba3456593ae6c.tar.gz Paper-76fab035d3bfda66934fced90e8ba3456593ae6c.zip |
don't go below 0 for pickupDelay, breaks picking up items
vanilla checks for == 0
Fixes #1911
3 files changed, 30 insertions, 7 deletions
diff --git a/Spigot-Server-Patches/0180-PlayerPickupItemEvent-setFlyAtPlayer.patch b/Spigot-Server-Patches/0180-PlayerPickupItemEvent-setFlyAtPlayer.patch index 92c8ce76f3..5dd11660ae 100644 --- a/Spigot-Server-Patches/0180-PlayerPickupItemEvent-setFlyAtPlayer.patch +++ b/Spigot-Server-Patches/0180-PlayerPickupItemEvent-setFlyAtPlayer.patch @@ -1,11 +1,11 @@ -From d2dc3091b8657b318b2813a1e3ab7a1eed394ae8 Mon Sep 17 00:00:00 2001 +From 1afd93a126d91c9ed1d852bc9c065c6dbdd29ec0 Mon Sep 17 00:00:00 2001 From: BillyGalbreath <[email protected]> Date: Sun, 7 May 2017 06:26:09 -0500 Subject: [PATCH] PlayerPickupItemEvent#setFlyAtPlayer diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index 39a804b7c..643793d55 100644 +index 39a804b7c..921a56c31 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -308,6 +308,7 @@ public class EntityItem extends Entity { @@ -30,10 +30,11 @@ index 39a804b7c..643793d55 100644 return; } -@@ -336,6 +343,11 @@ public class EntityItem extends Entity { +@@ -335,7 +342,11 @@ public class EntityItem extends Entity { + // CraftBukkit end if (this.pickupDelay == 0 && (this.g == null || 6000 - this.age <= 200 || this.g.equals(entityhuman.getUniqueID())) && entityhuman.inventory.pickup(itemstack)) { - entityhuman.receive(this, i); +- entityhuman.receive(this, i); + // Paper Start + if (flyAtPlayer) { + entityhuman.receive(this, i); diff --git a/Spigot-Server-Patches/0378-Implement-getters-and-setters-for-EntityItem-owner-a.patch b/Spigot-Server-Patches/0378-Implement-getters-and-setters-for-EntityItem-owner-a.patch index 0ba71c455d..777de9752d 100644 --- a/Spigot-Server-Patches/0378-Implement-getters-and-setters-for-EntityItem-owner-a.patch +++ b/Spigot-Server-Patches/0378-Implement-getters-and-setters-for-EntityItem-owner-a.patch @@ -1,4 +1,4 @@ -From bacfdeb718a1a43b35ea4cefdd5c1ca4bd00b434 Mon Sep 17 00:00:00 2001 +From 3b7348ab1fc8bd6b8918e0b6a4626ef178eb22aa Mon Sep 17 00:00:00 2001 From: BillyGalbreath <[email protected]> Date: Sat, 6 Oct 2018 20:54:23 -0500 Subject: [PATCH] Implement getters and setters for EntityItem owner and @@ -6,10 +6,10 @@ Subject: [PATCH] Implement getters and setters for EntityItem owner and diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index 6752d0b8c..03fee65e4 100644 +index c9473087a..e723bd339 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java -@@ -411,20 +411,22 @@ public class EntityItem extends Entity { +@@ -410,20 +410,22 @@ public class EntityItem extends Entity { this.getDataWatcher().markDirty(EntityItem.b); // CraftBukkit - SPIGOT-4591, must mark dirty } diff --git a/Spigot-Server-Patches/0428-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch b/Spigot-Server-Patches/0428-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch new file mode 100644 index 0000000000..e461c87e97 --- /dev/null +++ b/Spigot-Server-Patches/0428-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch @@ -0,0 +1,22 @@ +From 7b2b7b222801b793995cbc5b917933a50a47c772 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/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java +index e723bd339..cf00d0c88 100644 +--- a/src/main/java/net/minecraft/server/EntityItem.java ++++ b/src/main/java/net/minecraft/server/EntityItem.java +@@ -58,6 +58,7 @@ public class EntityItem 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 +-- +2.21.0 + |