diff options
author | Wesley Wolfe <weswolf@aol.com> | 2014-01-23 23:02:40 -0600 |
---|---|---|
committer | Wesley Wolfe <weswolf@aol.com> | 2014-01-23 23:24:59 -0600 |
commit | 516a02b8bb5010ee720a2d955b8ee4297e6f9095 (patch) | |
tree | 2a7c82cd45fe187e262756e47968d8c96a418d43 /src/main/java/org/bukkit | |
parent | a46eac8bcebbc7554d344f78d915bb0462057cc0 (diff) | |
download | craftbukkit-516a02b8bb5010ee720a2d955b8ee4297e6f9095.tar craftbukkit-516a02b8bb5010ee720a2d955b8ee4297e6f9095.tar.gz craftbukkit-516a02b8bb5010ee720a2d955b8ee4297e6f9095.tar.lz craftbukkit-516a02b8bb5010ee720a2d955b8ee4297e6f9095.tar.xz craftbukkit-516a02b8bb5010ee720a2d955b8ee4297e6f9095.zip |
Fix stacking for items after setting empty meta. Fixes BUKKIT-5331
ItemStacks do not stack if one has null for a tag, while the other has an
empty tag. In CraftItemStack, if you set an item to an empty ItemMeta, it
will create an empty tag for the internal ItemStack.
This changes the setItemMeta function to check for empty meta, and then
use null for the tag instead of an empty NBTTagCompound.
Diffstat (limited to 'src/main/java/org/bukkit')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java | 2 |
1 files changed, 1 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 04ae4ec8..704be690 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -360,7 +360,7 @@ public final class CraftItemStack extends ItemStack { if (item == null) { return false; } - if (itemMeta == null) { + if (CraftItemFactory.instance().equals(itemMeta, null)) { item.tag = null; return true; } |