This commit is contained in:
Luna 2023-02-25 14:37:46 -03:00 committed by GitHub
parent 95982e53d4
commit 06a169e968
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -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
}