From 4f72e6dd87a68fc9d93c3fe6cf6a38723e2566ed Mon Sep 17 00:00:00 2001 From: Maxim Date: Sat, 22 Oct 2022 11:38:49 +0200 Subject: Added check to API if the block should drop its inventory on break (#1479) * Added check to API if the block should drop its inventory on break * Apply spotless * Changed should drop flag to take index argument --- src/main/java/gregtech/common/blocks/GT_Block_Machines.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java index 7a1ae279c1..3aeb2f0a5e 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java @@ -414,7 +414,10 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo if (!(tGregTechTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_QuantumChest)) { for (int i = 0; i < tGregTechTileEntity.getSizeInventory(); i++) { final ItemStack tItem = tGregTechTileEntity.getStackInSlot(i); - if ((tItem != null) && (tItem.stackSize > 0) && (tGregTechTileEntity.isValidSlot(i))) { + if ((tItem != null) + && (tItem.stackSize > 0) + && (tGregTechTileEntity.isValidSlot(i)) + && tGregTechTileEntity.shouldDropItemAt(i)) { final EntityItem tItemEntity = new EntityItem( aWorld, aX + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, -- cgit