summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormushroomhostage <mushroomhostage@yahoo.com>2012-02-10 17:53:22 -0800
committerEvilSeph <evilseph@gmail.com>2012-02-13 00:46:34 -0500
commita1a3f7ffbaff612c91d0e95abd5a40832c244c43 (patch)
tree24a1a7891a7d60bb846b4666b532388c66c774d4
parente675ff791d0b0aad5d9724e165e2cbdbeae81366 (diff)
downloadbukkit-a1a3f7ffbaff612c91d0e95abd5a40832c244c43.tar
bukkit-a1a3f7ffbaff612c91d0e95abd5a40832c244c43.tar.gz
bukkit-a1a3f7ffbaff612c91d0e95abd5a40832c244c43.tar.lz
bukkit-a1a3f7ffbaff612c91d0e95abd5a40832c244c43.tar.xz
bukkit-a1a3f7ffbaff612c91d0e95abd5a40832c244c43.zip
Allow cloning ItemStacks with unsafe enchantments. Fixes BUKKIT-621
Prevents "IllegalArgumentException: Specified enchantment cannot be applied to this itemstack").
-rw-r--r--src/main/java/org/bukkit/inventory/ItemStack.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 95dc1f10..c730db62 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -211,7 +211,7 @@ public class ItemStack implements ConfigurationSerializable {
@Override
public ItemStack clone() {
ItemStack result = new ItemStack(type, amount, durability);
- result.addEnchantments(getEnchantments());
+ result.addUnsafeEnchantments(getEnchantments());
return result;
}