From 128fa39f5a992bdc45ce084cdf5ab143ff12886c Mon Sep 17 00:00:00 2001 From: Luna Date: Sun, 13 Mar 2022 14:39:58 -0300 Subject: [PATCH] ItemEntity - Check if items are air before calling setItem --- ...-if-items-are-air-before-calling-set.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 patches/server/0009-ItemEntity-Check-if-items-are-air-before-calling-set.patch diff --git a/patches/server/0009-ItemEntity-Check-if-items-are-air-before-calling-set.patch b/patches/server/0009-ItemEntity-Check-if-items-are-air-before-calling-set.patch new file mode 100644 index 0000000..48337b0 --- /dev/null +++ b/patches/server/0009-ItemEntity-Check-if-items-are-air-before-calling-set.patch @@ -0,0 +1,26 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Luna +Date: Sun, 13 Mar 2022 14:38:38 -0300 +Subject: [PATCH] ItemEntity - Check if items are air before calling setItem + + +diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +index 063f3e4c67e6716c9a03dbe4b72eafd32e4f0d53..03b8cc0ae12f17cf3a1c57958cf10ca23750b92a 100644 +--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java ++++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +@@ -377,11 +377,14 @@ public class ItemEntity extends Entity { + + CompoundTag nbttagcompound1 = nbt.getCompound("Item"); + +- this.setItem(ItemStack.of(nbttagcompound1)); ++ // Scissors start + if (this.getItem().isEmpty()) { + this.discard(); ++ return; + } + ++ this.setItem(ItemStack.of(nbttagcompound1)); ++ // Scissors end + } + + @Override