diff options
author | NotAPenguin <michiel.vandeginste@gmail.com> | 2024-08-13 21:36:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-13 21:36:36 +0200 |
commit | 43dff7d6baf163dcc39b054a53f1442488a3e389 (patch) | |
tree | 7d10cb3482d0edf5b165c6861235bc3224942f37 /src/main/java/gregtech/common/tileentities/machines | |
parent | 8ab3d7a6da0fe28a8ed80088bb89d5786784e5a3 (diff) | |
download | GT5-Unofficial-43dff7d6baf163dcc39b054a53f1442488a3e389.tar.gz GT5-Unofficial-43dff7d6baf163dcc39b054a53f1442488a3e389.tar.bz2 GT5-Unofficial-43dff7d6baf163dcc39b054a53f1442488a3e389.zip |
Adjust T4 waterline logic to avoid automation cheese (#2886)
Diffstat (limited to 'src/main/java/gregtech/common/tileentities/machines')
-rw-r--r-- | src/main/java/gregtech/common/tileentities/machines/multi/purification/GT_MetaTileEntity_PurificationUnitPhAdjustment.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/purification/GT_MetaTileEntity_PurificationUnitPhAdjustment.java b/src/main/java/gregtech/common/tileentities/machines/multi/purification/GT_MetaTileEntity_PurificationUnitPhAdjustment.java index 5c65e105dd..c885a5f974 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/purification/GT_MetaTileEntity_PurificationUnitPhAdjustment.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/purification/GT_MetaTileEntity_PurificationUnitPhAdjustment.java @@ -55,6 +55,7 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_StructureUtility; import gregtech.api.util.GT_Utility; import gregtech.api.util.IGT_HatchAdder; +import gregtech.api.util.shutdown.SimpleShutDownReason; public class GT_MetaTileEntity_PurificationUnitPhAdjustment extends GT_MetaTileEntity_PurificationUnitBase<GT_MetaTileEntity_PurificationUnitPhAdjustment> @@ -349,6 +350,7 @@ public class GT_MetaTileEntity_PurificationUnitPhAdjustment + "of 7.0 pH at the end of the cycle, the recipe always succeeds.") .addInfo("Otherwise, the recipe always fails.") .addInfo("Use a pH Sensor Hatch to read the current pH value.") + .addInfo("For safety, the machine will shut down if the pH goes below 0 or exceeds 14.") .addSeparator() .addInfo( "Every " + EnumChatFormatting.RED @@ -508,6 +510,11 @@ public class GT_MetaTileEntity_PurificationUnitPhAdjustment // Round to 2 decimals this.currentpHValue = Math.round(this.currentpHValue * 100.0f) / 100.0f; + + // If pH is 0 or 14, stop the machine + if (Math.abs(this.currentpHValue) < 0.001 || Math.abs(this.currentpHValue - 14.0f) < 0.001) { + stopMachine(SimpleShutDownReason.ofNormal("critical_ph_value")); + } } } |