diff options
author | Glease <4586901+Glease@users.noreply.github.com> | 2022-03-19 02:49:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-18 19:49:25 +0100 |
commit | 53eef4d9fb1dda70e605a42ef483eed92de72d27 (patch) | |
tree | 7528f2e7a86e88852129beb0575e5265ae080a2a /src/main/java/gregtech/common/tileentities/machines/basic | |
parent | 70d93a41f8567cc08a2ba3ecc8049de841b065bc (diff) | |
download | GT5-Unofficial-53eef4d9fb1dda70e605a42ef483eed92de72d27.tar.gz GT5-Unofficial-53eef4d9fb1dda70e605a42ef483eed92de72d27.tar.bz2 GT5-Unofficial-53eef4d9fb1dda70e605a42ef483eed92de72d27.zip |
make miner output to correct slots (#985)
* make miner output to correct slots
* fix git derp
Diffstat (limited to 'src/main/java/gregtech/common/tileentities/machines/basic')
-rw-r--r-- | src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java index cf3ed75291..65ab904498 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner.java @@ -286,9 +286,12 @@ public class GT_MetaTileEntity_Miner extends GT_MetaTileEntity_BasicMachine impl /** Pushes (or check can push) item to output slots. */ @Override public boolean pushOutputs(ItemStack stack, int count, boolean simulate, boolean allowInputSlots) { - int startSlot = allowInputSlots ? getInputSlot() : getOutputSlot(); - int maxSlot = mInventory.length; - for (int i = startSlot; i < maxSlot; i++) { + return allowInputSlots && pushOutput(getInputSlot(), getInputSlot() + mInputSlotCount, stack, count, simulate) || + pushOutput(getOutputSlot(), mOutputItems.length, stack, count, simulate); + } + + private boolean pushOutput(int startIndex, int endIndex, ItemStack stack, int count, boolean simulate) { + for (int i = startIndex; i < endIndex; i++) { ItemStack slot = mInventory[i]; if (slot == null || slot.stackSize == 0) { if (!simulate) { |