mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 04:55:47 +01:00
4e994669d3
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: 6b3c598b PR-814: Add a method to send multiple equipment changes 181a984b Update Maven shade version to align with CraftBukkit a5a36e32 Revert "Update Maven shade version to align with CraftBukkit" 7a8f4a42 Update Maven shade version to align with CraftBukkit 58327201 Add support for Java 20 CraftBukkit Changes: b56426c7a PR-1142: Calculate explosion damage separately for each affected EntityComplexPart fbe3410af PR-1140: Add a method to send multiple equipment changes 8434e3633 Add support for Java 20 c998a1d23 Increase outdated build delay 4a929b5d6 SPIGOT-7267: Fix EntityType#getTranslationKey() and add unit test 086d8dc8a SPIGOT-7268: CraftMetaPotion reads ShowParticles and ShowIcon properties incorrectly 8ba5e399e SPIGOT-7262: Improve visibility API Spigot Changes: a2190e30 Rebuild patches
31 lines
1.4 KiB
Diff
31 lines
1.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Josh Roy <joshroy126@gmail.com>
|
|
Date: Mon, 23 Jan 2023 19:19:01 -0500
|
|
Subject: [PATCH] Remove CraftItemStack#setAmount null assignment
|
|
|
|
This creates a problem with Paper's item serialization
|
|
api where deserialized items, which are internally
|
|
created as a CraftItemStack, will be completely lost if
|
|
#setAmount(0) is invoked (since the underlying handle
|
|
is set to null), while a regular Bukkit ItemStack
|
|
simply sets the amount field to zero, retaining the
|
|
item's data.
|
|
|
|
Vanilla treats items with zero amounts the same as items
|
|
with less than zero amounts, so this code doesn't create
|
|
a problem with operations on the vanilla ItemStack.
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
|
index 3e5abea2f814a0a364cf87ff4ce1b1718ba2ddac..97c5a72096ac0fd0b08a397466486014cfea4579 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
|
@@ -146,7 +146,7 @@ public final class CraftItemStack extends ItemStack {
|
|
}
|
|
|
|
this.handle.setCount(amount);
|
|
- if (amount == 0) {
|
|
+ if (false && amount == 0) { // Paper - remove CraftItemStack#setAmount null assignment
|
|
this.handle = null;
|
|
}
|
|
}
|