mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
Fix ItemMeta#removeEnchantments (#10886)
This commit is contained in:
parent
87f8c7ca9b
commit
4c472e3401
1 changed files with 11 additions and 0 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
|
@ -895,6 +897,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
this.lore = lore != null ? io.papermc.paper.adventure.PaperAdventure.asVanilla(lore) : null;
|
||||
}
|
||||
// Paper end
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@Override
|
||||
public void removeEnchantments() {
|
||||
if (this.hasEnchants()) {
|
||||
- this.enchantments.clear();
|
||||
+ this.enchantments = null; // Paper - Correctly clear enchantments
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
// Paper end
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue