diff options
author | miozune <miozune@gmail.com> | 2023-07-18 00:18:38 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-17 17:18:38 +0200 |
commit | e3576b233aaf41022cd9c4b94385d843439b0d5b (patch) | |
tree | 0f9053b7702c3b3117bb9c349a2bba8f0cd8287b /src/main/java/gregtech | |
parent | b3594d776957ffb087026704952443861ddcfb82 (diff) | |
download | GT5-Unofficial-e3576b233aaf41022cd9c4b94385d843439b0d5b.tar.gz GT5-Unofficial-e3576b233aaf41022cd9c4b94385d843439b0d5b.tar.bz2 GT5-Unofficial-e3576b233aaf41022cd9c4b94385d843439b0d5b.zip |
Fix division by zero error with VoidProtectionHelper (#2144)
Diffstat (limited to 'src/main/java/gregtech')
-rw-r--r-- | src/main/java/gregtech/api/util/VoidProtectionHelper.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/gregtech/api/util/VoidProtectionHelper.java b/src/main/java/gregtech/api/util/VoidProtectionHelper.java index 3ca9621f06..67e412bc83 100644 --- a/src/main/java/gregtech/api/util/VoidProtectionHelper.java +++ b/src/main/java/gregtech/api/util/VoidProtectionHelper.java @@ -173,7 +173,7 @@ public class VoidProtectionHelper { // Iterate over the outputs, calculating require stack spacing they will require. for (FluidStack aY : fluidOutputs) { - if (aY == null) { + if (aY == null || aY.amount <= 0) { continue; } tFluidOutputMap.merge(aY, aY.amount, Integer::sum); @@ -244,7 +244,9 @@ public class VoidProtectionHelper { int tSlotsFree = 0; for (ItemStack tItem : itemOutputs) { // GT_RecipeBuilder doesn't handle null item output - if (tItem == null) continue; + if (tItem == null || tItem.stackSize <= 0) { + continue; + } tItemOutputMap.merge(tItem, tItem.stackSize, Integer::sum); tParallels.put(tItem, new ParallelData(0, 0)); } |