From b0cb90fa0448d6d17e4479b1ee89d76660f1fdb4 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Wed, 22 Jan 2020 13:45:15 +1100 Subject: [PATCH] SPIGOT-5534: ItemStack copy constructor can cause legacy layer to load By: md_5 --- paper-api/src/main/java/org/bukkit/inventory/ItemStack.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paper-api/src/main/java/org/bukkit/inventory/ItemStack.java b/paper-api/src/main/java/org/bukkit/inventory/ItemStack.java index 9d9df827b5..180c292fc9 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/paper-api/src/main/java/org/bukkit/inventory/ItemStack.java @@ -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); }