aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java
index bc28090155..735b7dbe53 100644
--- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java
+++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/helper/TecTechUtils.java
@@ -79,18 +79,20 @@ public class TecTechUtils {
if (allTheEu < aEU)
return false;
+ if (hatches == 0) return false;
+
long euperhatch = aEU / hatches;
- boolean hasDrained = false;
+ boolean hasDrained = true;
for (GT_MetaTileEntity_Hatch_Energy tHatch : multi.getVanillaEnergyHatches())
- hasDrained |= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false);
+ hasDrained &= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false);
for (GT_MetaTileEntity_Hatch_EnergyTunnel tHatch : multi.getTecTechEnergyTunnels())
- hasDrained |= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false);
+ hasDrained &= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false);
for (GT_MetaTileEntity_Hatch_EnergyMulti tHatch : multi.getTecTechEnergyMultis())
- hasDrained |= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false);
+ hasDrained &= tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(euperhatch, false);
return hasDrained && (multi.getVanillaEnergyHatches().size() > 0 || multi.getTecTechEnergyTunnels().size() > 0 || multi.getTecTechEnergyMultis().size() > 0);
}
@@ -146,4 +148,4 @@ public class TecTechUtils {
public static long getEUPerTickFromLaser(GT_MetaTileEntity_Hatch_EnergyTunnel tHatch) {
return tHatch.Amperes * tHatch.maxEUInput() - (tHatch.Amperes / 20);
}
-} \ No newline at end of file
+}