Skip to content

Commit

Permalink
Methane cracking (#21)
Browse files Browse the repository at this point in the history
* added recipes for methane cracking and removed gtceu recipe

* updated changelog

* added steam duh
  • Loading branch information
tekcay authored Jan 26, 2024
1 parent b920e17 commit bf0ed3e
Show file tree
Hide file tree
Showing 7 changed files with 142 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
## v0.2

### Features
- added methane cracking recipes in the cracking unit and removed the GTCEu one.
Subsequent products must be distilled to recover the desired hydrogen
([#21](https://github.com/tekcay/tkcy-simple-addon/pull/21))


### Internal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import tkcy.simpleaddon.api.unification.TKCYSAFirstDegreeMaterials;
import tkcy.simpleaddon.api.unification.iconset.MaterialIconAddition;
import tkcy.simpleaddon.api.unification.materials.chains.*;
import tkcy.simpleaddon.api.unification.materials.other.MethaneCracking;
import tkcy.simpleaddon.api.unification.materials.other.MiscMaterials;
import tkcy.simpleaddon.api.unification.properties.PropertiesAddition;

Expand All @@ -27,6 +28,7 @@ public static void init() {
id = FluorineChainMaterials.init(id);
id = ManganeseChainMaterials.register(id);
id = SmallChains.init(id);
id = MethaneCracking.register(id);

id = AlloysMaterials.init(id);

Expand Down Expand Up @@ -147,4 +149,9 @@ public static void init() {
// Misc
public static Material Ceramic;
public static Material MicaPulp;

// MethaneCracking
public static Material LightlySteamCrackedMethane;
public static Material ModeratelySteamCrackedMethane;
public static Material SeverelySteamCrackedMethane;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package tkcy.simpleaddon.api.unification.materials.other;

import static gregtech.api.unification.material.Materials.*;
import static gregtech.api.util.GTUtility.gregtechId;
import static tkcy.simpleaddon.api.unification.materials.TKCYSAMaterials.*;

import gregtech.api.unification.material.Material;

public class MethaneCracking {

public static int register(int startId) {
LightlySteamCrackedMethane = new Material.Builder(startId++, gregtechId("lightly_steam_cracked_methane"))
.fluid()
.components(Hydrogen, 3, CarbonMonoxide, 2, DistilledWater, 2)
.colorAverage()
.build();

ModeratelySteamCrackedMethane = new Material.Builder(startId++, gregtechId("moderately_steam_cracked_methane"))
.fluid()
.components(Hydrogen, 6, CarbonMonoxide, 1, DistilledWater, 2)
.colorAverage()
.build();

SeverelySteamCrackedMethane = new Material.Builder(startId++, gregtechId("severely_steam_cracked_methane"))
.fluid()
.components(Hydrogen, 4, CarbonDioxide, 1, DistilledWater, 4)
.colorAverage()
.build();

LightlySteamCrackedMethane.setFormula("");
ModeratelySteamCrackedMethane.setFormula("");
SeverelySteamCrackedMethane.setFormula("");

return startId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ public static class HarderStuff {
public boolean enableHarderPolarization = true;
public boolean removeTinCircuitRecipes = true;
public boolean enableHarderComponents = true;
public boolean enableMethaneCracking = true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public static void init() {
if (harderStuff.enableHarderPolarization) HarderPolarization.init();
if (harderStuff.removeTinCircuitRecipes) CircuitRecipes.init();
if (harderStuff.enableHarderComponents) HarderComponents.init();
if (harderStuff.enableMethaneCracking) MethaneCracking.init();

MTEs.init();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package tkcy.simpleaddon.loaders.recipe.handlers.harderstuff;

import static gregtech.api.GTValues.HV;
import static gregtech.api.GTValues.VA;
import static gregtech.api.recipes.RecipeMaps.CHEMICAL_RECIPES;
import static gregtech.api.recipes.RecipeMaps.DISTILLATION_RECIPES;
import static gregtech.api.unification.material.Materials.*;
import static gregtech.api.unification.material.Materials.Hydrogen;
import static tkcy.simpleaddon.api.unification.materials.TKCYSAMaterials.*;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;

import gregtech.api.recipes.Recipe;
import gregtech.api.recipes.RecipeMaps;
import gregtech.api.recipes.ingredients.IntCircuitIngredient;

public class MethaneCracking {

public static void init() {
removeGTCEuRecipe();
addDistillationRecipes();
addMethaneCrackingRecipes();
}

private static void addMethaneCrackingRecipes() {
// 2 CH4 + H2O -> 2 CO + 3 H2
RecipeMaps.CRACKING_RECIPES.recipeBuilder()
.notConsumable(new IntCircuitIngredient(1))
.fluidInputs(Methane.getFluid(1000))
.fluidInputs(Steam.getFluid(1000))
.fluidOutputs(LightlySteamCrackedMethane.getFluid(1000))
.duration(120).EUt(120).buildAndRegister();

// CH4 + H2O -> CO + 3 H2
RecipeMaps.CRACKING_RECIPES.recipeBuilder()
.notConsumable(new IntCircuitIngredient(2))
.fluidInputs(Methane.getFluid(1000))
.fluidInputs(Steam.getFluid(1000))
.fluidOutputs(ModeratelySteamCrackedMethane.getFluid(1000))
.duration(120).EUt(180).buildAndRegister();

// CH4 + 2 H2O -> CO2 + 4 H2
RecipeMaps.CRACKING_RECIPES.recipeBuilder()
.notConsumable(new IntCircuitIngredient(3))
.fluidInputs(Methane.getFluid(1000))
.fluidInputs(Steam.getFluid(1000))
.fluidOutputs(SeverelySteamCrackedMethane.getFluid(1000))
.duration(120).EUt(240).buildAndRegister();
}

private static void addDistillationRecipes() {
DISTILLATION_RECIPES.recipeBuilder()
.fluidInputs(LightlySteamCrackedMethane.getFluid(1000))
.fluidOutputs(DistilledWater.getFluid(1000))
.fluidOutputs(CarbonMonoxide.getFluid(1000))
.fluidOutputs(Hydrogen.getFluid(1500))
.duration(120).EUt(120).buildAndRegister();

DISTILLATION_RECIPES.recipeBuilder()
.fluidInputs(ModeratelySteamCrackedMethane.getFluid(1000))
.fluidOutputs(DistilledWater.getFluid(2000))
.fluidOutputs(CarbonMonoxide.getFluid(1000))
.fluidOutputs(Hydrogen.getFluid(3000))
.duration(120).EUt(120).buildAndRegister();

DISTILLATION_RECIPES.recipeBuilder()
.fluidInputs(SeverelySteamCrackedMethane.getFluid(1000))
.fluidOutputs(DistilledWater.getFluid(4000))
.fluidOutputs(CarbonDioxide.getFluid(1000))
.fluidOutputs(Hydrogen.getFluid(4000))
.duration(120).EUt(120).buildAndRegister();
}

private static void removeGTCEuRecipe() {
List<ItemStack> circuit = Collections.singletonList(IntCircuitIngredient.getIntegratedCircuit(1));

List<FluidStack> input = new ArrayList<>();
input.add(Water.getFluid(2000));
input.add(Methane.getFluid(1000));

Recipe gtceuRecipe = CHEMICAL_RECIPES.findRecipe(VA[HV], circuit, input);
if (gtceuRecipe != null) CHEMICAL_RECIPES.removeRecipe(gtceuRecipe);
}
}
5 changes: 5 additions & 0 deletions src/main/resources/assets/tkcysa/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ gregtech.material.aluminium_6061=Aluminium 6061
gregtech.material.ceramic=Ceramic
gregtech.material.mica_pulp=Mica Based

##Methane cracking
gregtech.material.severely_steam_cracked_methane=Severely Steam Cracked Methane
gregtech.material.moderately_steam_cracked_methane=Moderately Steam Cracked Methane
gregtech.material.lightly_steam_cracked_methane=Lightly Steam Cracked Methane

##MTEs
tkcysa.machine.primitive_roasting_oven.name=Primitive Roasting Oven
tkcysa.machine.electrolyzer.name=Electrolyzer
Expand Down

0 comments on commit bf0ed3e

Please sign in to comment.