Fix ItemMeta#removeEnchantments (#10886)
This commit is contained in:
parent
3889ffb436
commit
af7f0c49f3
2 changed files with 13 additions and 2 deletions
|
@ -9,6 +9,8 @@ public net/minecraft/world/food/FoodProperties DEFAULT_EAT_SECONDS
|
|||
public org/bukkit/craftbukkit/block/CraftBlockStates getBlockState(Lorg/bukkit/World;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/block/entity/BlockEntity;)Lorg/bukkit/craftbukkit/block/CraftBlockState;
|
||||
public net/minecraft/world/level/block/entity/BlockEntity saveId(Lnet/minecraft/nbt/CompoundTag;)V
|
||||
|
||||
Co-authored-by: GhastCraftHD <julius.gruenberg@leghast.de>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index 066feef97f92b3f788dd6d25d188f2cc36fc4c80..7c7b9b1e0b604b0164b431873e6753b60421f970 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
|
@ -830,7 +832,7 @@ index 8e0dd4b7a7a25a8beb27b507047bc48d8227627c..77489c3ffaa3a72d4cf105499a77150f
|
|||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
index 705d7365a7bab9fe29b90a175040e6a1623e21a7..8ccb8d71ee489891e8d9128a5520675dd3a62786 100644
|
||||
index 5d86861a0df7308ae9b8440e5d9136fa7c8f1835..7d15711ffc908dff8a01f2425d729b449c5ed617 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
@@ -175,9 +175,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
|
@ -906,6 +908,15 @@ index 705d7365a7bab9fe29b90a175040e6a1623e21a7..8ccb8d71ee489891e8d9128a5520675d
|
|||
this.lore = lore != null ? io.papermc.paper.adventure.PaperAdventure.asVanilla(lore) : null;
|
||||
}
|
||||
// Paper end
|
||||
@@ -1094,7 +1099,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@Override
|
||||
public void removeEnchantments() {
|
||||
if (this.hasEnchants()) {
|
||||
- this.enchantments.clear();
|
||||
+ this.enchantments = null; // Paper - Correctly clear enchantments
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1160,6 +1165,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
// Paper end
|
||||
@Override
|
||||
|
|
|
@ -32,7 +32,7 @@ index 9d74577af071954e1e37201a96368c1360076209..eafa54c870c3e2aef30c3f9f96f51660
|
|||
throw new IllegalArgumentException("Not implemented. This is a bug");
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
index 8ccb8d71ee489891e8d9128a5520675dd3a62786..ad51c62b80bfd8f09c57e9ed1e73aad12341293a 100644
|
||||
index 7d15711ffc908dff8a01f2425d729b449c5ed617..b6686a42fe1eb29e00907105291e9e4a0baa08e0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
@@ -1367,7 +1367,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
|
|
Loading…
Reference in a new issue