2022-07-28 03:57:50 +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
|
2024-02-24 22:32:31 +00:00
|
|
|
index c7f06c3cfb737bd17a706798bf9cf0e1af5f0cc0..4fd00227d035284688e641cb2c55a3214dcbaa38 100644
|
2022-07-28 03:57:50 +00:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
2024-02-24 22:32:31 +00:00
|
|
|
@@ -445,11 +445,15 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
2022-07-28 03:57:50 +00:00
|
|
|
|
|
|
|
CompoundTag nbttagcompound1 = nbt.getCompound("Item");
|
|
|
|
|
|
|
|
- this.setItem(ItemStack.of(nbttagcompound1));
|
2023-02-25 17:37:46 +00:00
|
|
|
- if (this.getItem().isEmpty()) {
|
2024-02-24 22:32:31 +00:00
|
|
|
- this.discard(null); // CraftBukkit - add Bukkit remove cause
|
2022-07-28 03:57:50 +00:00
|
|
|
+ // Scissors start
|
2023-02-25 17:37:46 +00:00
|
|
|
+ ItemStack item = ItemStack.of(nbttagcompound1);
|
|
|
|
+ if (item.isEmpty()) {
|
2024-02-24 22:32:31 +00:00
|
|
|
+ this.discard(null);
|
2022-07-28 03:57:50 +00:00
|
|
|
+ return;
|
|
|
|
}
|
|
|
|
|
2023-02-25 17:37:46 +00:00
|
|
|
+ this.setItem(item);
|
2022-07-28 03:57:50 +00:00
|
|
|
+ // Scissors end
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|