diff options
author | Jake Potrebic <[email protected]> | 2023-10-22 12:12:00 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2023-10-22 20:12:00 +0100 |
commit | 90fe0d58a5945c31f2c1b138799f64f2fe3475d8 (patch) | |
tree | 57e2a8b12dbe8245ce5694dd15af35dc33c3c4c2 /patches/server/0484-Item-no-age-no-player-pickup.patch | |
parent | 489bff9bbdc4215bd2cbc54d837463c608e7747e (diff) | |
download | Paper-90fe0d58a5945c31f2c1b138799f64f2fe3475d8.tar.gz Paper-90fe0d58a5945c31f2c1b138799f64f2fe3475d8.zip |
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9825)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
897a0a23 SPIGOT-5753: Back PotionType by a minecraft registry
255b2aa1 SPIGOT-7080: Add World#locateNearestBiome
ff984826 Remove javadoc.io doc links
CraftBukkit Changes:
71b0135cc SPIGOT-5753: Back PotionType by a minecraft registry
a6bcb8489 SPIGOT-7080: Add World#locateNearestBiome
ad0e57434 SPIGOT-7502: CraftMetaItem - cannot deserialize BlockStateTag
b3efca57a SPIGOT-6400: Use Mockito instead of InvocationHandler
38c599f9d PR-1272: Only allow one entity in CraftItem instead of two
f065271ac SPIGOT-7498: ChunkSnapshot.getBlockEmittedLight() gets 64 blocks upper in Overworld
Spigot Changes:
e0e223fe Remove javadoc.io doc links
Diffstat (limited to 'patches/server/0484-Item-no-age-no-player-pickup.patch')
-rw-r--r-- | patches/server/0484-Item-no-age-no-player-pickup.patch | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/patches/server/0484-Item-no-age-no-player-pickup.patch b/patches/server/0484-Item-no-age-no-player-pickup.patch index 6501bec6d6..09109439e5 100644 --- a/patches/server/0484-Item-no-age-no-player-pickup.patch +++ b/patches/server/0484-Item-no-age-no-player-pickup.patch @@ -5,45 +5,44 @@ Subject: [PATCH] Item no age & no player pickup diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java -index 66e69cb13e2d82acc0a2398625766a49bc701a09..ff6868ab31cec208045353c842f20ca31191bc0a 100644 +index b1be6c99ebff90ff98a7d5cafec4a856b9704b66..43f6422fedae4304801c7be21990725eca11fc62 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java -@@ -9,6 +9,12 @@ import org.bukkit.entity.Item; - import org.bukkit.inventory.ItemStack; +@@ -9,6 +9,11 @@ import org.bukkit.inventory.ItemStack; public class CraftItem extends CraftEntity implements Item { -+ + + // Paper start + private final static int NO_AGE_TIME = (int) Short.MIN_VALUE; + private final static int NO_PICKUP_TIME = (int) Short.MAX_VALUE; + // Paper end + - private final ItemEntity item; - - public CraftItem(CraftServer server, Entity entity, ItemEntity item) { -@@ -75,6 +81,26 @@ public class CraftItem extends CraftEntity implements Item { + public CraftItem(CraftServer server, ItemEntity entity) { + super(server, entity); + } +@@ -73,6 +78,26 @@ public class CraftItem extends CraftEntity implements Item { public void setCanMobPickup(boolean canMobPickup) { - item.canMobPickup = canMobPickup; + this.getHandle().canMobPickup = canMobPickup; } + + @Override + public boolean canPlayerPickup() { -+ return item.pickupDelay != NO_PICKUP_TIME; ++ return this.getHandle().pickupDelay != NO_PICKUP_TIME; + } + + @Override + public void setCanPlayerPickup(boolean canPlayerPickup) { -+ item.pickupDelay = canPlayerPickup ? 0 : NO_PICKUP_TIME; ++ this.getHandle().pickupDelay = canPlayerPickup ? 0 : NO_PICKUP_TIME; + } + + @Override + public boolean willAge() { -+ return item.age != NO_AGE_TIME; ++ return this.getHandle().age != NO_AGE_TIME; + } + + @Override + public void setWillAge(boolean willAge) { -+ item.age = willAge ? 0 : NO_AGE_TIME; ++ this.getHandle().age = willAge ? 0 : NO_AGE_TIME; + } // Paper End |