mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 03:22:19 +01:00
Fix error when cloning enchanted ItemStacks.
The existing method for cloning a Bukkit ItemStack fails to correctly copy the underlying enchantments. Fix this by overriding .clone() in CraftItemStack, cloning the underlying nms ItemStack correctly. Fixes BUKKIT-360 By: Andrew Ardill <andrew.ardill@gmail.com>
This commit is contained in:
parent
0b7a5891c5
commit
e3b0e1e651
1 changed files with 5 additions and 0 deletions
|
@ -210,6 +210,11 @@ public class CraftItemStack extends ItemStack {
|
|||
return item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CraftItemStack clone() {
|
||||
return new CraftItemStack(this.item.cloneItemStack());
|
||||
}
|
||||
|
||||
public static net.minecraft.server.ItemStack createNMSItemStack(ItemStack original) {
|
||||
return new CraftItemStack(original).getHandle();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue