option to disable shulker box items from dropping contents when destroyed

This commit is contained in:
William Blake Galbreath
2025-01-12 11:38:38 -08:00
committed by granny
parent 19a65e8dcf
commit 137ef963b1
3 changed files with 10 additions and 39 deletions

View File

@@ -8,3 +8,11 @@
return customData.loadInto(blockEntity, level.registryAccess());
}
@@ -264,6 +_,7 @@
public void onDestroyed(ItemEntity itemEntity) {
ItemContainerContents itemContainerContents = itemEntity.getItem().set(DataComponents.CONTAINER, ItemContainerContents.EMPTY);
if (itemContainerContents != null) {
+ if (itemEntity.level().purpurConfig.shulkerBoxItemDropContentsWhenDestroyed && this.getBlock() instanceof ShulkerBoxBlock) // Purpur - option to disable shulker box items from dropping contents when destroyed
ItemUtils.onContainerDestroyed(itemEntity, itemContainerContents.nonEmptyItemsCopy());
}
}