From c3ff46b22323c47add29c4098b8ab2df5d85bde8 Mon Sep 17 00:00:00 2001 From: Steelux <70096037+Steelux8@users.noreply.github.com> Date: Wed, 12 Oct 2022 18:00:31 +0100 Subject: 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> --- .../machines/multi/GT_MetaTileEntity_HeatExchanger.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') 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 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 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; -- cgit