Skip to content

Commit

Permalink
feat: coolant config as requested by Zalgo
Browse files Browse the repository at this point in the history
  • Loading branch information
bruberu committed Jun 4, 2024
1 parent 20b1b3f commit 97156ca
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
5 changes: 5 additions & 0 deletions src/main/java/gregtech/common/ConfigHolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ public static class MachineOptions {
"This does NOT apply to the World Accelerator, but to external effects like Time in a Bottle.",
"Default: true" })
public boolean allowTickAcceleration = true;

@Config.Comment({ "The amount of water (in liters) that can be boiled by a single liter of hot coolant.", "Default: 1" })
@Config.RangeInt(min = 0)
public double coolantRecovery = 1;

}

public static class WorldGenOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import gregtech.api.unification.material.Materials;
import gregtech.api.unification.material.properties.CoolantProperty;
import gregtech.api.unification.material.properties.PropertyKey;
import gregtech.common.ConfigHolder;

public class FluidRecipeHandler {

Expand All @@ -17,24 +18,26 @@ public static void runRecipeGeneration() {
}

public static void processCoolant(Material mat, CoolantProperty coolant) {
int water = (int) (ConfigHolder.machines.coolantRecovery * 6);
RecipeMaps.HEAT_EXCHANGER_RECIPES.recipeBuilder().duration(1).circuitMeta(1)
.fluidInputs(coolant.getHotHPCoolant().getFluid(6), Materials.Water.getFluid(6))
.fluidOutputs(mat.getFluid(6), Materials.Steam.getFluid(960))
.fluidInputs(coolant.getHotHPCoolant().getFluid(6), Materials.Water.getFluid(water))
.fluidOutputs(mat.getFluid(6), Materials.Steam.getFluid(water * 160))
.buildAndRegister();

RecipeMaps.HEAT_EXCHANGER_RECIPES.recipeBuilder().duration(1).circuitMeta(1)
.fluidInputs(coolant.getHotHPCoolant().getFluid(6), Materials.DistilledWater.getFluid(6))
.fluidOutputs(mat.getFluid(6), Materials.Steam.getFluid(960))
.fluidInputs(coolant.getHotHPCoolant().getFluid(6), Materials.DistilledWater.getFluid(water))
.fluidOutputs(mat.getFluid(6), Materials.Steam.getFluid(water * 160))
.buildAndRegister();

water = (int) (ConfigHolder.machines.coolantRecovery * 600);
RecipeMaps.HEAT_EXCHANGER_RECIPES.recipeBuilder().duration(1).circuitMeta(2)
.fluidInputs(coolant.getHotHPCoolant().getFluid(600), Materials.Water.getFluid(600))
.fluidOutputs(mat.getFluid(600), Materials.Steam.getFluid(96000))
.fluidInputs(coolant.getHotHPCoolant().getFluid(6), Materials.Water.getFluid(water))
.fluidOutputs(mat.getFluid(6), Materials.Steam.getFluid(water * 160))
.buildAndRegister();

RecipeMaps.HEAT_EXCHANGER_RECIPES.recipeBuilder().duration(1).circuitMeta(2)
.fluidInputs(coolant.getHotHPCoolant().getFluid(600), Materials.DistilledWater.getFluid(600))
.fluidOutputs(mat.getFluid(600), Materials.Steam.getFluid(96000))
.fluidInputs(coolant.getHotHPCoolant().getFluid(6), Materials.DistilledWater.getFluid(water))
.fluidOutputs(mat.getFluid(6), Materials.Steam.getFluid(water * 160))
.buildAndRegister();

// Radiator
Expand Down

0 comments on commit 97156ca

Please sign in to comment.