aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0967-General-ItemMeta-fixes.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0967-General-ItemMeta-fixes.patch')
-rw-r--r--patches/server/0967-General-ItemMeta-fixes.patch22
1 files changed, 16 insertions, 6 deletions
diff --git a/patches/server/0967-General-ItemMeta-fixes.patch b/patches/server/0967-General-ItemMeta-fixes.patch
index 3ae66da1f8..321e5f3b03 100644
--- a/patches/server/0967-General-ItemMeta-fixes.patch
+++ b/patches/server/0967-General-ItemMeta-fixes.patch
@@ -68,10 +68,20 @@ index e28bc898786542f695017ff0a036676840eb79fe..cee3fe00cc662f095e7d726b5f1a913c
protected void load(T tileEntity) {
if (tileEntity != null && tileEntity != this.snapshot) {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
-index 6a449bfc765bf427d82df4a90bc60471b5de2fd3..033918e051ef44de82a74097380cacaf926e5408 100644
+index 6a449bfc765bf427d82df4a90bc60471b5de2fd3..69b7eb7eff112b59b22f1d349831b9ee14c01943 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
-@@ -341,7 +341,14 @@ public final class CraftItemStack extends ItemStack {
+@@ -279,7 +279,9 @@ public final class CraftItemStack extends ItemStack {
+
+ @Override
+ public void removeEnchantments() {
++ if (this.handle != null) { // Paper - fix NPE
+ this.handle.remove(DataComponents.ENCHANTMENTS);
++ } // Paper
+ }
+
+ @Override
+@@ -341,7 +343,14 @@ public final class CraftItemStack extends ItemStack {
// Paper end - improve handled tags on type change
// Paper start
public static void applyMetaToItem(net.minecraft.world.item.ItemStack itemStack, ItemMeta itemMeta) {
@@ -87,7 +97,7 @@ index 6a449bfc765bf427d82df4a90bc60471b5de2fd3..033918e051ef44de82a74097380cacaf
((CraftMetaItem) itemMeta).applyToItem(tag);
itemStack.applyComponents(tag.build());
}
-@@ -389,15 +396,20 @@ public final class CraftItemStack extends ItemStack {
+@@ -389,15 +398,20 @@ public final class CraftItemStack extends ItemStack {
if (itemMeta == null) return true;
if (!((CraftMetaItem) itemMeta).isEmpty()) {
@@ -445,7 +455,7 @@ index d7e5491cc0296563fb9fdf28d64b21a10c08ea4a..224ea52574b80bb087c5c62eaf1d4626
private static Material shieldToBannerHack() {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java
-index e064af399dcae40b4f35aa993d356b1462f91d6c..27a275f324891e395bf3fd3038c0b9a724bbbf66 100644
+index 257c835bc280eee9ee73ae75b5249bb568a687d0..70f20de37c1f8d57a8d9fe00dcd864fdd9948ec2 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java
@@ -34,7 +34,7 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta, WritableBo
@@ -458,7 +468,7 @@ index e064af399dcae40b4f35aa993d356b1462f91d6c..27a275f324891e395bf3fd3038c0b9a7
// We store the pages in their raw original text representation. See SPIGOT-5063, SPIGOT-5350, SPIGOT-3206
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java
-index 806c1cbee7c4e23eee38c8f400ec2d924c9a360c..d357c8ddf06aea99bac6b43c1e20d2e99f98d034 100644
+index cbb3d80cc7cd81b2505dff999a0baede737165f7..040dac82e484cb44b3afd444b4bbd1fd994bfe7c 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java
@@ -124,13 +124,13 @@ public class CraftMetaBookSigned extends CraftMetaItem implements BookMeta {
@@ -1399,7 +1409,7 @@ index ab860f1179fa2618c8fbc30ac5f48ff78b8abb60..7de2ed297d0b2bf8adf2058e75a9b594
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java
-index e4b8637e6d82e2ce7cfee2130e6422f0ef4e1fbc..49751354ecd3d401726e8989eb3c09b2de7ae4dc 100644
+index 8ddf091b3ff1262b6c97e8fe72e0a80db5e1037d..be92ccda66f514459773916cc16b6c230e863444 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java
@@ -121,6 +121,7 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta {