Made it so that multiblocks will look for empty output hatches.

Previously when there was more than one fluid output multiblocks would
only try to put it into one of the output hatches.
This commit is contained in:
Johannes Gäßler 2017-07-10 22:36:11 +02:00
parent da2e748e8a
commit bb68a5f74b

View file

@ -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) {