diff options
author | BlueWeabo <76872108+BlueWeabo@users.noreply.github.com> | 2022-10-01 13:10:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-01 12:10:15 +0200 |
commit | 32d74ba4d4f17af68335c5af3fcc44e20da25fd0 (patch) | |
tree | f7741bd2dcfba31bf8aa878c3996a7111cebbe2f /src/main/java/gregtech/common/tileentities/machines/multi | |
parent | 51a41123b0ccdf10cb7b311f8d87d250f78d1b89 (diff) | |
download | GT5-Unofficial-32d74ba4d4f17af68335c5af3fcc44e20da25fd0.tar.gz GT5-Unofficial-32d74ba4d4f17af68335c5af3fcc44e20da25fd0.tar.bz2 GT5-Unofficial-32d74ba4d4f17af68335c5af3fcc44e20da25fd0.zip |
With recent changes, Allow PA to handle cell-less recipes (#1346)
* add recipe maps, and allow PA to handle more than 1 fluid output
* add some null checks
* add forestry combs to the recipe map
* safety null checks.
* spotless
Diffstat (limited to 'src/main/java/gregtech/common/tileentities/machines/multi')
-rw-r--r-- | src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java index 538290a4e8..0e68b0f312 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java @@ -330,8 +330,10 @@ public class GT_MetaTileEntity_ProcessingArray tOut[h].stackSize = 0; } } - FluidStack tFOut = null; - if (aRecipe.getFluidOutput(0) != null) tFOut = aRecipe.getFluidOutput(0).copy(); + FluidStack[] tFOut = new FluidStack[aRecipe.mFluidOutputs.length]; + for (int i = 0; i < aRecipe.mFluidOutputs.length; i++) + if (aRecipe.getFluidOutput(i) != null) + tFOut[i] = aRecipe.getFluidOutput(i).copy(); for (int f = 0; f < tOut.length; f++) { if (aRecipe.mOutputs[f] != null && tOut[f] != null) { for (int g = 0; g < parallel; g++) { @@ -340,9 +342,13 @@ public class GT_MetaTileEntity_ProcessingArray } } } - if (tFOut != null) { - int tSize = tFOut.amount; - tFOut.amount = tSize * parallel; + byte oNumber = 0; + for (FluidStack fluidStack : tFOut) { + if (fluidStack != null) { + int tSize = fluidStack.amount; + tFOut[oNumber].amount = tSize * parallel; + } + oNumber++; } this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputItems = Arrays.stream(tOut) @@ -350,7 +356,7 @@ public class GT_MetaTileEntity_ProcessingArray .flatMap(GT_MetaTileEntity_ProcessingArray::splitOversizedStack) .filter(is -> is.stackSize > 0) .toArray(ItemStack[]::new); - this.mOutputFluids = new FluidStack[] {tFOut}; + this.mOutputFluids = tFOut; updateSlots(); return true; } |