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:
parent
da2e748e8a
commit
bb68a5f74b
1 changed files with 15 additions and 12 deletions
|
@ -263,12 +263,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity {
|
||||||
}
|
}
|
||||||
addOutput(tStack);
|
addOutput(tStack);
|
||||||
}
|
}
|
||||||
if (mOutputFluids != null && mOutputFluids.length == 1) {
|
if (mOutputFluids != null) {
|
||||||
for (FluidStack tStack : mOutputFluids)
|
|
||||||
if (tStack != null) {
|
|
||||||
addOutput(tStack);
|
|
||||||
}
|
|
||||||
} else if (mOutputFluids != null && mOutputFluids.length > 1) {
|
|
||||||
addFluidOutputs(mOutputFluids);
|
addFluidOutputs(mOutputFluids);
|
||||||
}
|
}
|
||||||
mEfficiency = Math.max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000)));
|
mEfficiency = Math.max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000)));
|
||||||
|
@ -554,12 +549,20 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addFluidOutputs(FluidStack[] mOutputFluids2) {
|
protected void addFluidOutputs(FluidStack[] mOutputFluids2) {
|
||||||
for (int i = 0; i < mOutputFluids2.length; i++) {
|
for (FluidStack outputFluidStack : mOutputFluids2) {
|
||||||
if (mOutputHatches.size() > i && mOutputHatches.get(i) != null && mOutputFluids2[i] != null && isValidMetaTileEntity(mOutputHatches.get(i))) {
|
if (outputFluidStack != null) {
|
||||||
mOutputHatches.get(i).fill(mOutputFluids2[i], true);
|
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) {
|
public boolean depleteInput(FluidStack aLiquid) {
|
||||||
|
|
Loading…
Reference in a new issue