Fix colored shulker box contents not dropping when destroyed, supercedes #1594

This commit is contained in:
granny
2024-10-03 18:08:35 -07:00
parent 51f15eef1c
commit 3d0716df32

View File

@@ -6,14 +6,14 @@ Subject: [PATCH] option to disable shulker box items from dropping contents
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
index 3253361d91e2a2e68d354eaf3dd3e3cd486e191d..2649188930653610b8aaaeb18797c80879cd572a 100644
index 3253361d91e2a2e68d354eaf3dd3e3cd486e191d..a255b76cc1e6cb926585110e5f09ded37da7be20 100644
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java
@@ -260,6 +260,7 @@ public class BlockItem extends Item {
ItemContainerContents itemcontainercontents = (ItemContainerContents) entity.getItem().set(DataComponents.CONTAINER, ItemContainerContents.EMPTY);
if (itemcontainercontents != null) {
+ if (entity.level().purpurConfig.shulkerBoxItemDropContentsWhenDestroyed && entity.getItem().is(Items.SHULKER_BOX)) // Purpur
+ if (entity.level().purpurConfig.shulkerBoxItemDropContentsWhenDestroyed && this.getBlock() instanceof ShulkerBoxBlock) // Purpur
ItemUtils.onContainerDestroyed(entity, itemcontainercontents.nonEmptyItemsCopy());
}