aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common
diff options
context:
space:
mode:
authorMaxim <maxim235@gmx.de>2022-10-22 11:38:49 +0200
committerGitHub <noreply@github.com>2022-10-22 11:38:49 +0200
commit4f72e6dd87a68fc9d93c3fe6cf6a38723e2566ed (patch)
treeeb59e6beb30dc58c50398f3c598d1b9614bb5f7b /src/main/java/gregtech/common
parente9ecca3f1aba7ef7ea5eaaea8b0baf8d1e7659c8 (diff)
downloadGT5-Unofficial-4f72e6dd87a68fc9d93c3fe6cf6a38723e2566ed.tar.gz
GT5-Unofficial-4f72e6dd87a68fc9d93c3fe6cf6a38723e2566ed.tar.bz2
GT5-Unofficial-4f72e6dd87a68fc9d93c3fe6cf6a38723e2566ed.zip
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
Diffstat (limited to 'src/main/java/gregtech/common')
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Machines.java5
1 files changed, 4 insertions, 1 deletions
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,