Scissors/patches/server/0009-ItemEntity-Check-if-items-are-air-before-calling-set.patch

27 lines
1015 B
Diff
Raw Normal View History

2022-06-11 04:28:30 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Luna <lunahatesgogle@gmail.com>
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 ae4b251e10babb07055d031ff48ac7dd5d4be4a0..36d57256c50fbd5e60c755ea47b608137d92ea50 100644
2022-06-11 04:28:30 +00:00
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
@@ -385,11 +385,14 @@ public class ItemEntity extends Entity {
2022-06-11 04:28:30 +00:00
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