mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-23 19:15:32 +01:00
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.
This commit is contained in:
parent
a46eac8bce
commit
516a02b8bb
@ -360,7 +360,7 @@ public final class CraftItemStack extends ItemStack {
|
|||||||
if (item == null) {
|
if (item == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (itemMeta == null) {
|
if (CraftItemFactory.instance().equals(itemMeta, null)) {
|
||||||
item.tag = null;
|
item.tag = null;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user