From 06a169e968b3a6501fd21b5485f4b938fd241d6d Mon Sep 17 00:00:00 2001 From: Luna <90072930+LunaWasFlaggedAgain@users.noreply.github.com> Date: Sat, 25 Feb 2023 14:37:46 -0300 Subject: [PATCH] Fix #72 (#73) --- ...ity-Check-if-items-are-air-before-calling-set.patch | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/patches/server/0008-ItemEntity-Check-if-items-are-air-before-calling-set.patch b/patches/server/0008-ItemEntity-Check-if-items-are-air-before-calling-set.patch index ab1c467..3adb30f 100644 --- a/patches/server/0008-ItemEntity-Check-if-items-are-air-before-calling-set.patch +++ b/patches/server/0008-ItemEntity-Check-if-items-are-air-before-calling-set.patch @@ -5,21 +5,23 @@ 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 f0ccdfbd7d7be8c6e302609accf8fe9cac8885c4..c82934529463be0adeb8585e7f702aebaf2a6a97 100644 +index f0ccdfbd7d7be8c6e302609accf8fe9cac8885c4..2dad46159fb1653aff0ecdd907535ac0c59deeed 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -@@ -407,11 +407,14 @@ public class ItemEntity extends Entity { +@@ -407,11 +407,15 @@ public class ItemEntity extends Entity { CompoundTag nbttagcompound1 = nbt.getCompound("Item"); - this.setItem(ItemStack.of(nbttagcompound1)); +- if (this.getItem().isEmpty()) { + // Scissors start - if (this.getItem().isEmpty()) { ++ ItemStack item = ItemStack.of(nbttagcompound1); ++ if (item.isEmpty()) { this.discard(); + return; } -+ this.setItem(ItemStack.of(nbttagcompound1)); ++ this.setItem(item); + // Scissors end }