SPIGOT-5534: ItemStack copy constructor can cause legacy layer to load

This commit is contained in:
md_5 2020-01-22 13:45:15 +11:00
parent 538ceaff0e
commit d6b23768ee

View file

@ -101,7 +101,9 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
Validate.notNull(stack, "Cannot copy null stack");
this.type = stack.getType();
this.amount = stack.getAmount();
this.data = stack.getData();
if (this.type.isLegacy()) {
this.data = stack.getData();
}
if (stack.hasItemMeta()) {
setItemMeta0(stack.getItemMeta(), type);
}