Allow cloning ItemStacks with unsafe enchantments. Fixes BUKKIT-621

Prevents "IllegalArgumentException: Specified enchantment cannot be applied to this itemstack").

By: mushroomhostage <mushroomhostage@yahoo.com>
This commit is contained in:
Bukkit/Spigot 2012-02-10 17:53:22 -08:00
parent b7a973b822
commit e204abd0f0

View File

@ -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;
}