aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/1044-General-ItemMeta-fixes.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/1044-General-ItemMeta-fixes.patch')
-rw-r--r--patches/server/1044-General-ItemMeta-fixes.patch11
1 files changed, 10 insertions, 1 deletions
diff --git a/patches/server/1044-General-ItemMeta-fixes.patch b/patches/server/1044-General-ItemMeta-fixes.patch
index c8b54df4ad..11d78582bd 100644
--- a/patches/server/1044-General-ItemMeta-fixes.patch
+++ b/patches/server/1044-General-ItemMeta-fixes.patch
@@ -7,9 +7,18 @@ Subject: [PATCH] General ItemMeta fixes
private-f net/minecraft/world/item/ItemStack components
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
-index 8e2b3dd109dca3089cbce82cd3788874613a3230..a45389d64c04cd4c2a35fbc511595be0535a8665 100644
+index 8e2b3dd109dca3089cbce82cd3788874613a3230..893efb2c4a07c33d41e934279dd914a9dbd4ef79 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
+@@ -414,7 +414,7 @@ public final class ItemStack implements DataComponentHolder {
+ } finally {
+ world.captureBlockStates = false;
+ }
+- DataComponentPatch newData = this.getComponentsPatch();
++ DataComponentPatch newData = this.components.asPatch(); // Paper - Directly access components as patch instead of getComponentsPatch as said method yields EMPTY on items with count 0
+ int newCount = this.getCount();
+ this.setCount(oldCount);
+ this.restorePatch(oldData);
@@ -1251,6 +1251,11 @@ public final class ItemStack implements DataComponentHolder {
public void setItem(Item item) {
this.bukkitStack = null; // Paper