diff options
author | Caedis <Caedis@users.noreply.github.com> | 2024-02-19 11:31:53 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-19 11:31:53 -0600 |
commit | 467ed303919c45483b4db2a4895fdeb580aadd20 (patch) | |
tree | d82636bc48659bca3b0aad05c0420056b509afc3 /src/main/java/gregtech/common | |
parent | 8b397fb6206d6db2a710a77633f442a73a71c8ed (diff) | |
download | GT5-Unofficial-467ed303919c45483b4db2a4895fdeb580aadd20.tar.gz GT5-Unofficial-467ed303919c45483b4db2a4895fdeb580aadd20.tar.bz2 GT5-Unofficial-467ed303919c45483b4db2a4895fdeb580aadd20.zip |
Fix Cleanroom logic with an LV energy hatch (#2499)
* Fix Cleanroom logic with an LV energy hatch
* Spotless apply for branch fix/lvCleanroom for #2499 (#2500)
spotlessApply
Co-authored-by: GitHub GTNH Actions <>
* Only allow LV+ energy hatches to run
* change to use TierEU instead of magic value
* Spotless apply for branch fix/lvCleanroom for #2499 (#2501)
spotlessApply
Co-authored-by: GitHub GTNH Actions <>
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/main/java/gregtech/common')
-rw-r--r-- | src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java index 4c308370aa..cd31b9cc1e 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java @@ -27,6 +27,7 @@ import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; +import gregtech.api.enums.TierEU; import gregtech.api.interfaces.ICleanroom; import gregtech.api.interfaces.ICleanroomReceiver; import gregtech.api.interfaces.ISecondaryDescribable; @@ -36,6 +37,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicHull; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TooltipMultiBlockBase; import gregtech.api.recipe.check.CheckRecipeResult; +import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.recipe.check.SimpleCheckRecipeResult; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Log; @@ -124,8 +126,21 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_TooltipMultiB @Override public CheckRecipeResult checkProcessing() { mEfficiencyIncrease = 100; + final long inputVoltage = getMaxInputVoltage(); + + // only allow LV+ energy hatches + if (inputVoltage < TierEU.LV) { + return CheckRecipeResultRegistry.insufficientPower(40); + } + // use the standard overclock mechanism to determine duration and estimate a maximum consumption - calculateOverclockedNessMultiInternal(40, 45 * Math.max(1, mHeight - 1), 1, getMaxInputVoltage(), false); + // if the cleanroom is powered by an LV energy hatch, it will actually accept 2A instead of just 1A. + calculateOverclockedNessMultiInternal( + 40, + 45 * Math.max(1, mHeight - 1), + inputVoltage == TierEU.LV ? 2 : 1, + inputVoltage, + false); // negate it to trigger the special energy consumption function. divide by 10 to get the actual final // consumption. mEUt /= -10; |