diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaEnchantedBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaEnchantedBook.java index f975e867e9..8d44e55e66 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaEnchantedBook.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaEnchantedBook.java @@ -106,8 +106,8 @@ class CraftMetaEnchantedBook extends CraftMetaItem implements EnchantmentStorage public CraftMetaEnchantedBook clone() { CraftMetaEnchantedBook meta = (CraftMetaEnchantedBook) super.clone(); - if (hasStoredEnchants()) { - meta.enchantments = new HashMap(enchantments); + if (this.enchantments != null) { + meta.enchantments = new HashMap(this.enchantments); } return meta; diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java index 90e7ffc352..0e0bb32e1e 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -490,7 +490,14 @@ class CraftMetaItem implements ItemMeta, Repairable { @Override public CraftMetaItem clone() { try { - return (CraftMetaItem) super.clone(); + CraftMetaItem clone = (CraftMetaItem) super.clone(); + if (this.lore != null) { + clone.lore = new ArrayList(this.lore); + } + if (this.enchantments != null) { + clone.enchantments = new HashMap(this.enchantments); + } + return clone; } catch (CloneNotSupportedException e) { throw new Error(e); } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java index ca024d0bfc..e7d27d20ee 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java @@ -117,8 +117,8 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta { @Override public CraftMetaPotion clone() { CraftMetaPotion clone = (CraftMetaPotion) super.clone(); - if (hasCustomEffects()) { - clone.customEffects = new ArrayList(customEffects); + if (this.customEffects != null) { + clone.customEffects = new ArrayList(this.customEffects); } return clone; }