summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorfeildmaster <admin@feildmaster.com>2012-12-27 20:48:56 -0600
committerfeildmaster <admin@feildmaster.com>2012-12-27 20:48:56 -0600
commitb908c192bfafe568131a018d8a961b0e7f8e43ee (patch)
treea4a414f71eca57d314517d14b77eba3d07e2fd6e /src/main
parent54b2707ba7ef53f7d7523387d3aeab296152d628 (diff)
downloadcraftbukkit-b908c192bfafe568131a018d8a961b0e7f8e43ee.tar
craftbukkit-b908c192bfafe568131a018d8a961b0e7f8e43ee.tar.gz
craftbukkit-b908c192bfafe568131a018d8a961b0e7f8e43ee.tar.lz
craftbukkit-b908c192bfafe568131a018d8a961b0e7f8e43ee.tar.xz
craftbukkit-b908c192bfafe568131a018d8a961b0e7f8e43ee.zip
Fix removing enchantments causing the enchantment tag to remain.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index 5f2a6bd1..5110b6ca 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/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);