From 77ceb0002cf2c36d5177f1edeacc277cae2b956e Mon Sep 17 00:00:00 2001 From: Wesley Wolfe Date: Fri, 2 Mar 2012 12:52:45 -0600 Subject: [PATCH] Fix losing enchants from stacked items in custom inventories --- .../bukkit/craftbukkit/inventory/CraftInventoryCustom.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCustom.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCustom.java index 8621fcf02a..eb2546e6c9 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCustom.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCustom.java @@ -66,7 +66,7 @@ public class CraftInventoryCustom extends CraftInventory { this.setItem(i, null); result = stack; } else { - result = new ItemStack(stack.id, j, stack.getData()); + result = new ItemStack(stack.id, j, stack.getData(), stack.getEnchantments()); stack.count -= j; } this.update(); @@ -81,7 +81,7 @@ public class CraftInventoryCustom extends CraftInventory { this.setItem(i, null); result = stack; } else { - result = new ItemStack(stack.id, 1, stack.getData()); + result = new ItemStack(stack.id, 1, stack.getData(), stack.getEnchantments()); stack.count -= 1; } return result;