Scissors/patches/server/0006-Ignore-null-air-bundle-items-in-CraftMetaBundle.patch
2022-09-13 01:41:21 -05:00

24 lines
1.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Luna <lunahatesgogle@gmail.com>
Date: Sun, 13 Mar 2022 11:07:34 -0300
Subject: [PATCH] Ignore null/air bundle items in CraftMetaBundle
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBundle.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBundle.java
index e14318383403f12e26dd7801a9dbdea854df185f..bd3f516a9e9a47c9f00b681b0b457d308bfd1710 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBundle.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBundle.java
@@ -47,7 +47,11 @@ public class CraftMetaBundle extends CraftMetaItem implements BundleMeta {
for (int i = 0; i < list.size(); i++) {
CompoundTag nbttagcompound1 = list.getCompound(i);
- this.addItem(CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.of(nbttagcompound1)));
+ // Scissors start
+ CraftItemStack item = CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.of(nbttagcompound1));
+ if(item == null || item.getType().isAir()) continue;
+ this.addItem(item);
+ // Scissors end
}
}
}