From cc3776b0b49936acf9bf06b3e2a7250d8e26f5c6 Mon Sep 17 00:00:00 2001 From: Luna Date: Sun, 13 Mar 2022 11:08:25 -0300 Subject: [PATCH] Ignore null/air bundle items in CraftMetaBundle --- ...-air-bundle-items-in-CraftMetaBundle.patch | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 patches/server/0007-Ignore-null-air-bundle-items-in-CraftMetaBundle.patch diff --git a/patches/server/0007-Ignore-null-air-bundle-items-in-CraftMetaBundle.patch b/patches/server/0007-Ignore-null-air-bundle-items-in-CraftMetaBundle.patch new file mode 100644 index 0000000..5184fc3 --- /dev/null +++ b/patches/server/0007-Ignore-null-air-bundle-items-in-CraftMetaBundle.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Luna +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 8fd1e392258eba9dbe2194c024ad7e0ca3e43cf8..28be42594857f2d8320a035c1f8b95cdc300ddd5 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBundle.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBundle.java +@@ -49,7 +49,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 + } + } + }