aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/metatileentity/implementations
diff options
context:
space:
mode:
authorJohannes Gäßler <updrn@student.kit.edu>2017-08-01 09:01:03 +0200
committerDream-Master <dream-master@gmx.net>2017-08-01 22:53:13 +0200
commit88c63884b8c7a2562e1661149a535bbdd9da5196 (patch)
treef35ea55ee7dea1719cf47bda2d4fb49c4b3c10d1 /src/main/java/gregtech/api/metatileentity/implementations
parent054d81fc2769967738c678167c2fd720a1b2ba6f (diff)
downloadGT5-Unofficial-88c63884b8c7a2562e1661149a535bbdd9da5196.tar.gz
GT5-Unofficial-88c63884b8c7a2562e1661149a535bbdd9da5196.tar.bz2
GT5-Unofficial-88c63884b8c7a2562e1661149a535bbdd9da5196.zip
Made it so that empty slots are treated as Integ. Circ. with config 0
Diffstat (limited to 'src/main/java/gregtech/api/metatileentity/implementations')
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java
index b1a74ab303..4704fb753e 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java
@@ -632,7 +632,20 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
protected ItemStack[] getAllInputs() {
ItemStack[] rInputs = new ItemStack[mInputSlotCount];
- for (int i = 0; i < mInputSlotCount; i++) rInputs[i] = getInputAt(i);
+ int emptySlotLocation = -1;
+ for (int i = 0; i < mInputSlotCount; i++){
+ ItemStack currentInput = getInputAt(i);
+ if (emptySlotLocation == -1) {
+ if (currentInput == null) {
+ emptySlotLocation = i;
+ continue;
+ }
+ }
+ rInputs[i] = currentInput;
+ }
+ if (emptySlotLocation != -1) {
+ rInputs[emptySlotLocation] = GT_Utility.getIntegratedCircuit(0);
+ }
return rInputs;
}