mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-08 08:31:51 +01:00
SPIGOT-7174: Avoid adding air to CraftMetaBundle
By: Doc <nachito94@msn.com>
This commit is contained in:
parent
5d713025af
commit
532c51f79d
@ -47,7 +47,10 @@ public class CraftMetaBundle extends CraftMetaItem implements BundleMeta {
|
|||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
NBTTagCompound nbttagcompound1 = list.getCompound(i);
|
NBTTagCompound nbttagcompound1 = list.getCompound(i);
|
||||||
|
|
||||||
addItem(CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.of(nbttagcompound1)));
|
ItemStack itemStack = CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.of(nbttagcompound1));
|
||||||
|
if (!itemStack.getType().isAir()) { // SPIGOT-7174 - Avoid adding air
|
||||||
|
addItem(itemStack);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -59,8 +62,8 @@ public class CraftMetaBundle extends CraftMetaItem implements BundleMeta {
|
|||||||
Iterable<?> items = SerializableMeta.getObject(Iterable.class, map, ITEMS.BUKKIT, true);
|
Iterable<?> items = SerializableMeta.getObject(Iterable.class, map, ITEMS.BUKKIT, true);
|
||||||
if (items != null) {
|
if (items != null) {
|
||||||
for (Object stack : items) {
|
for (Object stack : items) {
|
||||||
if (stack instanceof ItemStack) {
|
if (stack instanceof ItemStack itemStack && !itemStack.getType().isAir()) { // SPIGOT-7174 - Avoid adding air
|
||||||
addItem((ItemStack) stack);
|
addItem(itemStack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user