Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-19 04:50:06 +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
Dieser Commit ist enthalten in:
Ursprung
acfb4f2fbe
Commit
1c6adc1587
@ -210,6 +210,11 @@ public class CraftItemStack extends ItemStack {
|
|||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CraftItemStack clone() {
|
||||||
|
return new CraftItemStack(this.item.cloneItemStack());
|
||||||
|
}
|
||||||
|
|
||||||
public static net.minecraft.server.ItemStack createNMSItemStack(ItemStack original) {
|
public static net.minecraft.server.ItemStack createNMSItemStack(ItemStack original) {
|
||||||
return new CraftItemStack(original).getHandle();
|
return new CraftItemStack(original).getHandle();
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren