Skip to content

Commit

Permalink
Config for num multiblock casings per craft (#2127)
Browse files Browse the repository at this point in the history
  • Loading branch information
serenibyss authored Oct 29, 2023
1 parent 762d2c0 commit 65c482c
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 74 deletions.
4 changes: 4 additions & 0 deletions src/main/java/gregtech/common/ConfigHolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ public static class RecipeOptions {

@Config.Comment({"Whether to make the recipe for the EBF Controller harder.", "Default: false"})
public boolean harderEBFControllerRecipe = false;

@Config.Comment({"How many Multiblock Casings to make per craft. Either 1, 2, or 3.", "Default: 2"})
@Config.RangeInt(min = 1, max = 3)
public int casingsPerCraft = 2;
}

public static class CompatibilityOptions {
Expand Down
17 changes: 11 additions & 6 deletions src/main/java/gregtech/loaders/MaterialInfoLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,20 @@ public static void init() {
));

OreDictUnifier.registerOre(MetaBlocks.CLEANROOM_CASING.getItemVariant(BlockCleanroomCasing.CasingType.PLASCRETE), new ItemMaterialInfo(
new MaterialStack(Materials.Steel, M), // frame / 2
new MaterialStack(Materials.Polyethylene, M * 3), // 6 sheets / 2
new MaterialStack(Materials.Concrete, M / 2) // 1 block / 2
new MaterialStack(Materials.Steel, (M * 2) / ConfigHolder.recipes.casingsPerCraft), // frame / config
new MaterialStack(Materials.Polyethylene, (M * 6) / ConfigHolder.recipes.casingsPerCraft), // 6 sheets / config
new MaterialStack(Materials.Concrete, M / ConfigHolder.recipes.casingsPerCraft) // 1 block / config
));

OreDictUnifier.registerOre(MetaBlocks.TRANSPARENT_CASING.getItemVariant(BlockGlassCasing.CasingType.CLEANROOM_GLASS), new ItemMaterialInfo(
new MaterialStack(Materials.Steel, M), // frame / 2
new MaterialStack(Materials.Polyethylene, M * 3), // 6 sheets / 2
new MaterialStack(Materials.Glass, M / 2) // 1 block / 2
new MaterialStack(Materials.Steel, (M * 2) / ConfigHolder.recipes.casingsPerCraft), // frame / config
new MaterialStack(Materials.Polyethylene, (M * 6) / ConfigHolder.recipes.casingsPerCraft), // 6 sheets / config
new MaterialStack(Materials.Glass, M / ConfigHolder.recipes.casingsPerCraft) // 1 block / config
));

OreDictUnifier.registerOre(MetaBlocks.METAL_CASING.getItemVariant(BlockMetalCasing.MetalCasingType.PTFE_INERT_CASING), new ItemMaterialInfo(
new MaterialStack(Materials.Steel, (M * 8) / ConfigHolder.recipes.casingsPerCraft), // casing / config
new MaterialStack(Materials.Polytetrafluoroethylene, M * 3 / 2) // 1.5 ingots PTFE (fluid in recipe)
));

OreDictUnifier.registerOre(MetaBlocks.METAL_CASING.getItemVariant(BlockMetalCasing.MetalCasingType.PRIMITIVE_BRICKS), new ItemMaterialInfo(new MaterialStack(Materials.Fireclay, M * 4)));
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/gregtech/loaders/recipe/ComputerRecipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import gregtech.api.recipes.ingredients.nbtmatch.NBTCondition;
import gregtech.api.recipes.ingredients.nbtmatch.NBTMatcher;
import gregtech.api.unification.material.MarkerMaterials.Tier;
import gregtech.common.ConfigHolder;
import gregtech.common.blocks.BlockComputerCasing;
import gregtech.common.blocks.BlockGlassCasing;
import net.minecraft.item.ItemStack;
Expand Down Expand Up @@ -47,7 +48,7 @@ public static void init() {
.input(wireFine, Cobalt, 16)
.input(wireFine, Copper, 16)
.input(wireGtSingle, NiobiumTitanium, 2)
.outputs(COMPUTER_CASING.getItemVariant(BlockComputerCasing.CasingType.HIGH_POWER_CASING, 2))
.outputs(COMPUTER_CASING.getItemVariant(BlockComputerCasing.CasingType.HIGH_POWER_CASING, ConfigHolder.recipes.casingsPerCraft))
.duration(100).EUt(VA[IV]).buildAndRegister();

ASSEMBLER_RECIPES.recipeBuilder()
Expand All @@ -57,7 +58,7 @@ public static void init() {
.input(wireFine, Cobalt, 32)
.input(wireFine, Copper, 32)
.input(wireGtSingle, VanadiumGallium, 2)
.outputs(COMPUTER_CASING.getItemVariant(BlockComputerCasing.CasingType.COMPUTER_CASING, 2))
.outputs(COMPUTER_CASING.getItemVariant(BlockComputerCasing.CasingType.COMPUTER_CASING, ConfigHolder.recipes.casingsPerCraft))
.duration(200).EUt(VA[LuV]).buildAndRegister();

ASSEMBLER_RECIPES.recipeBuilder()
Expand All @@ -76,7 +77,7 @@ public static void init() {
.input(pipeTinyFluid, StainlessSteel, 16)
.input(plate, Copper, 16)
.input(wireGtSingle, SamariumIronArsenicOxide)
.outputs(COMPUTER_CASING.getItemVariant(BlockComputerCasing.CasingType.COMPUTER_HEAT_VENT, 2))
.outputs(COMPUTER_CASING.getItemVariant(BlockComputerCasing.CasingType.COMPUTER_HEAT_VENT, ConfigHolder.recipes.casingsPerCraft))
.duration(100).EUt(VA[EV]).buildAndRegister();

ASSEMBLER_RECIPES.recipeBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ private static void loadCraftingRecipes() {

ModHandler.addShapedRecipe("blacklight", BLACKLIGHT.getStackForm(), "SPS", "GRG", "CPK", 'S', new UnificationEntry(OrePrefix.screw, TungstenCarbide), 'P', new UnificationEntry(OrePrefix.plate, TungstenCarbide), 'G', MetaBlocks.TRANSPARENT_CASING.getItemVariant(BlockGlassCasing.CasingType.LAMINATED_GLASS), 'R', new UnificationEntry(OrePrefix.spring, Europium), 'C', new UnificationEntry(OrePrefix.circuit, Tier.IV), 'K', new UnificationEntry(OrePrefix.cableGtSingle, Platinum));

ModHandler.addShapedRecipe(true, "filter_casing", MetaBlocks.CLEANROOM_CASING.getItemVariant(BlockCleanroomCasing.CasingType.FILTER_CASING, 2), "BBB", "III", "MFR", 'B', new ItemStack(Blocks.IRON_BARS), 'I', ITEM_FILTER.getStackForm(), 'M', ELECTRIC_MOTOR_MV.getStackForm(), 'F', new UnificationEntry(OrePrefix.frameGt, Steel), 'R', new UnificationEntry(OrePrefix.rotor, Steel));
ModHandler.addShapedRecipe(true, "filter_casing_sterile", MetaBlocks.CLEANROOM_CASING.getItemVariant(BlockCleanroomCasing.CasingType.FILTER_CASING_STERILE, 2), "BEB", "ISI", "MFR", 'B', new UnificationEntry(OrePrefix.pipeLargeFluid, Polybenzimidazole), 'E', EMITTER_ZPM.getStackForm(), 'I', ITEM_FILTER.getStackForm(), 'S', BLACKLIGHT.getStackForm(), 'M', ELECTRIC_MOTOR_ZPM.getStackForm(), 'F', new UnificationEntry(OrePrefix.frameGt, Tritanium), 'R', new UnificationEntry(OrePrefix.rotor, NaquadahAlloy));
ModHandler.addShapedRecipe(true, "filter_casing", MetaBlocks.CLEANROOM_CASING.getItemVariant(BlockCleanroomCasing.CasingType.FILTER_CASING, ConfigHolder.recipes.casingsPerCraft), "BBB", "III", "MFR", 'B', new ItemStack(Blocks.IRON_BARS), 'I', ITEM_FILTER.getStackForm(), 'M', ELECTRIC_MOTOR_MV.getStackForm(), 'F', new UnificationEntry(OrePrefix.frameGt, Steel), 'R', new UnificationEntry(OrePrefix.rotor, Steel));
ModHandler.addShapedRecipe(true, "filter_casing_sterile", MetaBlocks.CLEANROOM_CASING.getItemVariant(BlockCleanroomCasing.CasingType.FILTER_CASING_STERILE, ConfigHolder.recipes.casingsPerCraft), "BEB", "ISI", "MFR", 'B', new UnificationEntry(OrePrefix.pipeLargeFluid, Polybenzimidazole), 'E', EMITTER_ZPM.getStackForm(), 'I', ITEM_FILTER.getStackForm(), 'S', BLACKLIGHT.getStackForm(), 'M', ELECTRIC_MOTOR_ZPM.getStackForm(), 'F', new UnificationEntry(OrePrefix.frameGt, Tritanium), 'R', new UnificationEntry(OrePrefix.rotor, NaquadahAlloy));

///////////////////////////////////////////////////
// Shapes and Molds //
Expand Down
Loading

0 comments on commit 65c482c

Please sign in to comment.