From 2d0ea62fb2dcd0dacf39639baeecd4d930bb4174 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Thu, 27 Dec 2012 20:48:56 -0600 Subject: [PATCH] Fix removing enchantments causing the enchantment tag to remain. By: feildmaster --- .../java/org/bukkit/craftbukkit/inventory/CraftItemStack.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java index 5f2a6bd15d..5110b6cace 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -233,11 +233,12 @@ public final class CraftItemStack extends ItemStack { if (index == Integer.MIN_VALUE) { return 0; } - if (index == 0 && size == 0) { + if (index == 0 && size == 1) { handle.tag.o(ENCHANTMENTS.NBT); if (handle.tag.d()) { handle.tag = null; } + return ((NBTTagCompound) list.get(0)).getShort(ENCHANTMENTS_ID.NBT); } listCopy = new NBTTagList(ENCHANTMENTS.NBT);