From e1c46e67a5b7baecdc709dabf211cb2c10441844 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Fri, 27 Sep 2024 10:58:11 -0700 Subject: [PATCH] fix ItemStack#removeEnchantments creating non-stackable items (#11442) --- patches/server/General-ItemMeta-fixes.patch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/patches/server/General-ItemMeta-fixes.patch b/patches/server/General-ItemMeta-fixes.patch index 23d7f4604..6033d1e1c 100644 --- a/patches/server/General-ItemMeta-fixes.patch +++ b/patches/server/General-ItemMeta-fixes.patch @@ -75,8 +75,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public void removeEnchantments() { +- this.handle.remove(DataComponents.ENCHANTMENTS); + if (this.handle != null) { // Paper - fix NPE - this.handle.remove(DataComponents.ENCHANTMENTS); ++ this.handle.set(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY); // Paper - set to default instead of removing the component + } // Paper }