summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Adams <dinnerbone@dinnerbone.com>2012-01-14 12:46:23 +0000
committerNathan Adams <dinnerbone@dinnerbone.com>2012-01-14 12:46:23 +0000
commit3ee8a2372c150b912ed7b6a4347efd3275942d19 (patch)
treeb3e4968069c2e99ef18b5f46591a338d2465a925
parent84b0310ae8383e9c37ccbca672cf40aeab1cc4d0 (diff)
downloadcraftbukkit-3ee8a2372c150b912ed7b6a4347efd3275942d19.tar
craftbukkit-3ee8a2372c150b912ed7b6a4347efd3275942d19.tar.gz
craftbukkit-3ee8a2372c150b912ed7b6a4347efd3275942d19.tar.lz
craftbukkit-3ee8a2372c150b912ed7b6a4347efd3275942d19.tar.xz
craftbukkit-3ee8a2372c150b912ed7b6a4347efd3275942d19.zip
Additional commit to fix #BUKKIT-24
-rw-r--r--src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java6
1 files changed, 5 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 b1bde111..5e98c9d4 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -203,7 +203,11 @@ public class CraftItemStack extends ItemStack {
list.add(subtag);
}
- tag.set("ench", list);
+ if (enchantments.isEmpty()) {
+ tag.remove("ench");
+ } else {
+ tag.set("ench", list);
+ }
}
public net.minecraft.server.ItemStack getHandle() {