diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java index a02a5568..6c0f8f5a 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java @@ -263,13 +263,8 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { } addOutput(tStack); } - if (mOutputFluids != null && mOutputFluids.length == 1) { - for (FluidStack tStack : mOutputFluids) - if (tStack != null) { - addOutput(tStack); - } - } else if (mOutputFluids != null && mOutputFluids.length > 1) { - addFluidOutputs(mOutputFluids); + if (mOutputFluids != null) { + addFluidOutputs(mOutputFluids); } mEfficiency = Math.max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000))); mOutputItems = null; @@ -554,12 +549,20 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { } protected void addFluidOutputs(FluidStack[] mOutputFluids2) { - for (int i = 0; i < mOutputFluids2.length; i++) { - if (mOutputHatches.size() > i && mOutputHatches.get(i) != null && mOutputFluids2[i] != null && isValidMetaTileEntity(mOutputHatches.get(i))) { - mOutputHatches.get(i).fill(mOutputFluids2[i], true); - } + for (FluidStack outputFluidStack : mOutputFluids2) { + if (outputFluidStack != null) { + FluidStack copiedStack = outputFluidStack.copy(); + for (GT_MetaTileEntity_Hatch_Output outputhatch : mOutputHatches) { + if (copiedStack.amount <= 0) { + break; + } + if (!isValidMetaTileEntity(outputhatch)) { + continue; + } + copiedStack.amount -= outputhatch.fill(copiedStack, true); + } + } } - } public boolean depleteInput(FluidStack aLiquid) {