mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-31 22:22:49 +00:00
SPIGOT-5534: ItemStack copy constructor can cause legacy layer to load
This commit is contained in:
parent
538ceaff0e
commit
d6b23768ee
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue