aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteelux <70096037+Steelux8@users.noreply.github.com>2022-10-12 18:00:31 +0100
committerGitHub <noreply@github.com>2022-10-12 19:00:31 +0200
commitc3ff46b22323c47add29c4098b8ab2df5d85bde8 (patch)
tree77af4a48632aeb1cb3fc49926fcec409598b6ce4
parente49715ce5235c0a9c898d9e53d400aa875d7ee68 (diff)
downloadGT5-Unofficial-c3ff46b22323c47add29c4098b8ab2df5d85bde8.tar.gz
GT5-Unofficial-c3ff46b22323c47add29c4098b8ab2df5d85bde8.tar.bz2
GT5-Unofficial-c3ff46b22323c47add29c4098b8ab2df5d85bde8.zip
Add a Heating Counter for LHE Explosions (#1455)
* Add a Heating Counter for LHE Explosions - Change the LHE code to start counting up to a specific value on every tick where there's no distilled water, only exploding after a certain time has passed without water, instead of instantly. * Fixes * spotlessApply (#1456) Co-authored-by: Steelux <70096037+Steelux8@users.noreply.github.com> Co-authored-by: GitHub GTNH Actions <> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java
index 440da9a333..291641f9c6 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_HeatExchanger.java
@@ -38,6 +38,8 @@ import net.minecraftforge.fluids.FluidStack;
public class GT_MetaTileEntity_HeatExchanger
extends GT_MetaTileEntity_EnhancedMultiBlockBase<GT_MetaTileEntity_HeatExchanger>
implements ISurvivalConstructable {
+ private int dryHeatCounter = 0; // Counts up to dryHeatMaximum to check for explosion conditions
+ private static final int dryHeatMaximum = 2000; // 2000 ticks = 100 seconds
private static final int CASING_INDEX = 50;
private static final String STRUCTURE_PIECE_MAIN = "main";
private static final IStructureDefinition<GT_MetaTileEntity_HeatExchanger> STRUCTURE_DEFINITION =
@@ -278,9 +280,14 @@ public class GT_MetaTileEntity_HeatExchanger
} else {
addOutput(GT_ModHandler.getSteam(tGeneratedEU)); // Generate regular steam
}
+ dryHeatCounter = 0;
} else {
- GT_Log.exp.println(this.mName + " had no more Distilled water!");
- explodeMultiblock(); // Generate crater
+ if (dryHeatCounter < dryHeatMaximum) {
+ dryHeatCounter += 1;
+ } else {
+ GT_Log.exp.println(this.mName + " was too hot and had no more Distilled Water!");
+ explodeMultiblock(); // Generate crater
+ }
}
}
return true;