Skip to content

Commit

Permalink
Circuit Factory added and some recipes renamed some things
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveeTheEpic committed Oct 31, 2024
1 parent c16913b commit aae288b
Show file tree
Hide file tree
Showing 16 changed files with 151 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@
"behaviour.soft_hammer.disabled": "pǝןqɐsıᗡ buıʞɹoM",
"behaviour.soft_hammer.enabled": "pǝןqɐuƎ buıʞɹoM",
"behaviour.wrench": "ʞɔıןɔʇɥbıᴚ uo sʞɔoןᗺ sǝʇɐʇoᴚ",
"block.compactmachines.circuit_factory": "ɐƖ0˙ƖΛ ʎɹoʇɔɐℲ ʇınɔɹıƆ",
"block.compactmachines.circuit_factory_casing": "buısɐƆ ʎɹoʇɔɐℲ ʇınɔɹıƆ",
"block.compactmachines.compact_chemical_reactor": "ɹoʇɔɐǝᴚ ןɐɔıɯǝɥƆ ʇɔɐdɯoƆ",
"block.compactmachines.compact_chemical_reactor_casing": "buısɐƆ ɹoʇɔɐǝᴚ ןɐɔıɯǝɥƆ ʇɔɐdɯoƆ",
"block.compactmachines.pcb_factory": "ɐƖ0˙ƖΛ ʎɹoʇɔɐℲ ᗺƆԀ",
Expand Down Expand Up @@ -197,7 +199,8 @@
"command.gtceu.medical_condition.get.empty": "˙suoıʇıpuoɔ ןɐɔıpǝɯ ou sɐɥ %s ɹǝʎɐןԀ",
"command.gtceu.place_vein.failure": "%s uoıʇısod ʇɐ %s uıǝʌ ǝɔɐןd oʇ pǝןıɐℲ",
"command.gtceu.place_vein.success": "%s uoıʇısod ʇɐ %s uıǝʌ pǝɔɐןԀ",
"compactmachines.pcb_factory": "ʎɹoʇɔɐℲ qɔԀ",
"compactmachines.circuit_factory": "ʎɹoʇɔɐℲ ʇınɔɹıƆ",
"compactmachines.pcb_factory": "ƖɐƖ0˙ƖΛ ʎɹoʇɔɐℲ ᗺƆԀ",
"compass.node.gtceu.batteries/energy_cluster": "ɹǝʇsnןƆ ʎbɹǝuƎ",
"compass.node.gtceu.batteries/energy_crystal": "ןɐʇsʎɹƆ ʎbɹǝuƎ",
"compass.node.gtceu.batteries/energy_module": "ǝןnpoW ʎbɹǝuƎ",
Expand Down Expand Up @@ -587,7 +590,6 @@
"compass.node.gtceu.parts/fluid_passthrough_hatch": "ɥɔʇɐH ɥbnoɹɥʇssɐԀ pınןℲ",
"compass.node.gtceu.parts/item_bus": "snᗺ ɯǝʇI",
"compass.node.gtceu.parts/item_passthrough_hatch": "ɥɔʇɐH ɥbnoɹɥʇssɐԀ ɯǝʇI",
"compass.node.gtceu.parts/low_dual_hatch": "ɥɔʇɐH ןɐnᗡ ʍoꞀ",
"compass.node.gtceu.parts/machine_hull": "ןןnH ǝuıɥɔɐW",
"compass.node.gtceu.parts/maintenance_hatch": "ɥɔʇɐH ǝɔuɐuǝʇuıɐW",
"compass.node.gtceu.parts/muffler_hatch": "ɥɔʇɐH ɹǝןɟɟnW",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@
"behaviour.soft_hammer.disabled": "Working Disabled",
"behaviour.soft_hammer.enabled": "Working Enabled",
"behaviour.wrench": "Rotates Blocks on Rightclick",
"block.compactmachines.circuit_factory": "Circuit Factory V1.01a",
"block.compactmachines.circuit_factory_casing": "Circuit Factory Casing",
"block.compactmachines.compact_chemical_reactor": "Compact Chemical Reactor",
"block.compactmachines.compact_chemical_reactor_casing": "Compact Chemical Reactor Casing",
"block.compactmachines.pcb_factory": "PCB Factory V1.01a",
Expand Down Expand Up @@ -197,7 +199,8 @@
"command.gtceu.medical_condition.get.empty": "Player %s has no medical conditions.",
"command.gtceu.place_vein.failure": "Failed to place vein %s at position %s",
"command.gtceu.place_vein.success": "Placed vein %s at position %s",
"compactmachines.pcb_factory": "Pcb Factory",
"compactmachines.circuit_factory": "Circuit Factory",
"compactmachines.pcb_factory": "PCB Factory V1.01a1",
"compass.node.gtceu.batteries/energy_cluster": "Energy Cluster",
"compass.node.gtceu.batteries/energy_crystal": "Energy Crystal",
"compass.node.gtceu.batteries/energy_module": "Energy Module",
Expand Down Expand Up @@ -587,7 +590,6 @@
"compass.node.gtceu.parts/fluid_passthrough_hatch": "Fluid Passthrough Hatch",
"compass.node.gtceu.parts/item_bus": "Item Bus",
"compass.node.gtceu.parts/item_passthrough_hatch": "Item Passthrough Hatch",
"compass.node.gtceu.parts/low_dual_hatch": "Low Dual Hatch",
"compass.node.gtceu.parts/machine_hull": "Machine Hull",
"compass.node.gtceu.parts/maintenance_hatch": "Maintenance Hatch",
"compass.node.gtceu.parts/muffler_hatch": "Muffler Hatch",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "compactmachines:block/casings/solid/pcb_factory_casing"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "compactmachines:block/pcb_factory_casing"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"values": [
"compactmachines:compact_chemical_reactor_casing",
"compactmachines:pcb_factory_casing"
"compactmachines:pcb_factory_casing",
"compactmachines:circuit_factory_casing"
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"values": [
"compactmachines:compact_chemical_reactor_casing",
"compactmachines:pcb_factory_casing"
"compactmachines:pcb_factory_casing",
"compactmachines:circuit_factory_casing"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@



public class PCBFactoryMachine extends WorkableElectricMultiblockMachine {
public class EfficiencyFactoryMachine extends WorkableElectricMultiblockMachine {

private int efficiency = 100;

public PCBFactoryMachine(IMachineBlockEntity holder, Object... args) {
public EfficiencyFactoryMachine(IMachineBlockEntity holder, Object... args) {
super(holder, args);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.gregtechceu.gtceu.api.recipe.logic.OCParams;
import com.gregtechceu.gtceu.api.recipe.logic.OCResult;
import com.gregtechceu.gtceu.api.recipe.modifier.RecipeModifier;
import com.stevee.CompactMachines.api.machine.multiblock.PCBFactoryMachine;
import com.stevee.CompactMachines.api.machine.multiblock.EfficiencyFactoryMachine;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand All @@ -18,21 +18,21 @@ public class EfficiencyMultiplier implements RecipeModifier {
@Override
public @Nullable GTRecipe apply(MetaMachine machine, @NotNull GTRecipe recipe, @NotNull OCParams params, @NotNull OCResult result) {

if (!(machine instanceof PCBFactoryMachine pcbFactoryMachine)) return recipe;
if (!(machine instanceof EfficiencyFactoryMachine efficiencyFactoryMachine)) return recipe;

recipe = recipe.copy();
recipe.duration *= pcbFactoryMachine.getEfficiency();
recipe.duration *= efficiencyFactoryMachine.getEfficiency();
recipe.duration /= 100;

RecipeHelper.getInputContents(recipe, ItemRecipeCapability.CAP).forEach(ingredient -> {
Arrays.stream(ingredient.getItems()).iterator().forEachRemaining((itemStack) -> {
itemStack.setCount(itemStack.getCount() * Math.max((50 / pcbFactoryMachine.getEfficiency()), 1));
itemStack.setCount(itemStack.getCount() * Math.max((50 / efficiencyFactoryMachine.getEfficiency()), 1));
});
});

RecipeHelper.getOutputContents(recipe, ItemRecipeCapability.CAP).forEach(ingredient -> {
Arrays.stream(ingredient.getItems()).iterator().forEachRemaining(itemStack -> {
itemStack.setCount(itemStack.getCount() * Math.max(((pcbFactoryMachine.getEfficiency()) / 25), 1));
itemStack.setCount(itemStack.getCount() * Math.max(((efficiencyFactoryMachine.getEfficiency()) / 25), 1));
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public static void init() {}

public static final BlockEntry<Block> COMPACT_CHEMICAL_REACTOR_CASING = createCasingBlock("compact_chemical_reactor_casing", CompactMachinesMod.id("block/casings/solid/compact_chemical_reactor_casing"));
public static final BlockEntry<Block> PCB_FACTORY_CASING = createCasingBlock("pcb_factory_casing", CompactMachinesMod.id("block/casings/solid/pcb_factory_casing"));
public static final BlockEntry<Block> CIRCUIT_FACTORY_CASING = createCasingBlock("circuit_factory_casing", CompactMachinesMod.id("block/casings/solid/circuit_factory_casing"));

public static BlockEntry<Block> createCasingBlock(String name,
NonNullFunction<BlockBehaviour.Properties, Block> blockSupplier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

import com.gregtechceu.gtceu.GTCEu;
import com.gregtechceu.gtceu.api.GTValues;
import com.gregtechceu.gtceu.api.capability.recipe.IO;
import com.gregtechceu.gtceu.api.data.RotationState;
import com.gregtechceu.gtceu.api.machine.IMachineBlockEntity;
import com.gregtechceu.gtceu.api.machine.MachineDefinition;
import com.gregtechceu.gtceu.api.machine.MetaMachine;
import com.gregtechceu.gtceu.api.machine.multiblock.PartAbility;
import com.gregtechceu.gtceu.api.machine.multiblock.WorkableElectricMultiblockMachine;
import com.gregtechceu.gtceu.api.pattern.FactoryBlockPattern;
import com.gregtechceu.gtceu.api.pattern.Predicates;
Expand All @@ -17,13 +15,10 @@
import com.gregtechceu.gtceu.common.data.GTMachines;
import com.gregtechceu.gtceu.common.data.GTRecipeModifiers;
import com.gregtechceu.gtceu.common.data.GTRecipeTypes;
import com.gregtechceu.gtceu.common.machine.multiblock.part.DualHatchPartMachine;
import com.gregtechceu.gtceu.common.registry.GTRegistration;
import com.stevee.CompactMachines.CompactMachinesMod;
import com.stevee.CompactMachines.api.machine.multiblock.PCBFactoryMachine;
import com.stevee.CompactMachines.api.machine.multiblock.EfficiencyFactoryMachine;
import com.stevee.CompactMachines.api.recipe.modifier.EfficiencyMultiplier;
import com.stevee.CompactMachines.common.machine.multiblock.part.LowDualHatchPartMachine;
import net.minecraft.network.chat.Component;

import java.util.Locale;
import java.util.function.BiFunction;
Expand All @@ -32,8 +27,7 @@
import static com.gregtechceu.gtceu.api.pattern.Predicates.*;
import static com.gregtechceu.gtceu.common.data.GTBlocks.*;
import static com.stevee.CompactMachines.api.registries.Registrate.REGISTRATE;
import static com.stevee.CompactMachines.common.data.CMBlocks.COMPACT_CHEMICAL_REACTOR_CASING;
import static com.stevee.CompactMachines.common.data.CMBlocks.PCB_FACTORY_CASING;
import static com.stevee.CompactMachines.common.data.CMBlocks.*;

public class CMMachines {

Expand Down Expand Up @@ -69,7 +63,7 @@ public class CMMachines {
.register();

public static final MachineDefinition PCB_FACTORY = REGISTRATE
.multiblock("pcb_factory", PCBFactoryMachine::new)
.multiblock("pcb_factory", EfficiencyFactoryMachine::new)
.langValue("PCB Factory V1.01a")
.rotationState(RotationState.NON_Y_AXIS)
.recipeType(CMRecipeTypes.PCB_Factory)
Expand All @@ -89,7 +83,28 @@ public class CMMachines {
.workableCasingRenderer(CompactMachinesMod.id("block/casings/solid/pcb_factory_casing"), GTCEu.id("block/multiblock/large_chemical_reactor"))
.register();

public static final MachineDefinition[] LOW_DUAL_IMPORT_HATCH = registerTieredMachines("low_dual_input_hatch",
public static final MachineDefinition CIRCUIT_FACTORY = REGISTRATE
.multiblock("circuit_factory", EfficiencyFactoryMachine::new)
.langValue("Circuit Factory V1.01a")
.rotationState(RotationState.NON_Y_AXIS)
.recipeType(CMRecipeTypes.Circuit_Factory)
.recipeModifiers(GTRecipeModifiers.DEFAULT_ENVIRONMENT_REQUIREMENT,
new EfficiencyMultiplier())
.appearanceBlock(CIRCUIT_FACTORY_CASING)
.pattern(definition -> FactoryBlockPattern.start()
.aisle("DDD", "DDD", "DDD")
.aisle("DDD", "D#D", "DDD")
.aisle("DDD", "DCD", "DDD")
.where("D", autoAbilities(definition.getRecipeTypes())
.or(autoAbilities(true, false, true))
.or(blocks(CIRCUIT_FACTORY_CASING.get())))
.where("C", controller(blocks(definition.getBlock())))
.where("#", air())
.build())
.workableCasingRenderer(CompactMachinesMod.id("block/casings/solid/circuit_factory_casing"), GTCEu.id("block/multiblock/large_chemical_reactor"))
.register();

/*public static final MachineDefinition[] LOW_DUAL_IMPORT_HATCH = registerTieredMachines("low_dual_input_hatch",
(holder, tier) -> new LowDualHatchPartMachine(holder, tier, IO.IN),
(tier, builder) -> builder
.langValue("%s Low Dual Input Hatch".formatted(VNF[tier]))
Expand All @@ -108,7 +123,7 @@ public class CMMachines {
DualHatchPartMachine.INITIAL_TANK_CAPACITY, tier))),
Component.translatable("gtceu.universal.enabled"))
.compassNode("low_dual_hatch")
.register(), GTValues.tiersBetween(HV, IV));
.register(), GTValues.tiersBetween(HV, IV));*/


public static MachineDefinition[] registerTieredMachines(String name,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.stevee.CompactMachines.common.data;

import com.gregtechceu.gtceu.GTCEu;
import com.gregtechceu.gtceu.api.capability.recipe.IO;
import com.gregtechceu.gtceu.api.gui.GuiTextures;
import com.gregtechceu.gtceu.api.recipe.GTRecipeSerializer;
Expand Down Expand Up @@ -30,4 +29,11 @@ public static GTRecipeType register(String name, String group, RecipeType<?>...
.setProgressBar(GuiTextures.PROGRESS_BAR_CIRCUIT_ASSEMBLER, ProgressTexture.FillDirection.LEFT_TO_RIGHT)
.setSound(GTSoundEntries.ASSEMBLER);

public static final GTRecipeType Circuit_Factory = register("circuit_factory", "multiblock")
.setMaxIOSize(6, 1, 3, 0)
.setSlotOverlay(false, false, GuiTextures.CIRCUIT_OVERLAY)
.setEUIO(IO.IN)
.setProgressBar(GuiTextures.PROGRESS_BAR_CIRCUIT_ASSEMBLER, ProgressTexture.FillDirection.LEFT_TO_RIGHT)
.setSound(GTSoundEntries.ASSEMBLER);

}
5 changes: 4 additions & 1 deletion src/main/java/com/stevee/CompactMachines/data/CMDataGen.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
import com.gregtechceu.gtceu.data.lang.LangHandler;
import com.stevee.CompactMachines.api.registries.Registrate;
import com.stevee.CompactMachines.data.lang.BlockLang;
import com.stevee.CompactMachines.data.lang.GuiLang;
import com.tterrag.registrate.providers.ProviderType;

public class CMDataGen {

public static void init() {
Registrate.REGISTRATE.addDataGenerator(ProviderType.LANG, BlockLang::init);
Registrate.REGISTRATE.addDataGenerator(ProviderType.LANG, LangHandler::init);

Registrate.REGISTRATE.addDataGenerator(ProviderType.LANG, BlockLang::init);
Registrate.REGISTRATE.addDataGenerator(ProviderType.LANG, GuiLang::init);
}

}
17 changes: 17 additions & 0 deletions src/main/java/com/stevee/CompactMachines/data/lang/GuiLang.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.stevee.CompactMachines.data.lang;

import com.gregtechceu.gtceu.data.lang.LangHandler;
import com.tterrag.registrate.providers.RegistrateLangProvider;

public class GuiLang {


public static void init(RegistrateLangProvider provider) {
initGuiLang(provider);
}

private static void initGuiLang(RegistrateLangProvider provider) {
LangHandler.replace(provider, "compactmachines.pcb_factory", "PCB Factory V1.01a1");
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.stevee.CompactMachines.data.recipes;

import com.stevee.CompactMachines.data.recipes.misc.CircuitFactory;
import com.stevee.CompactMachines.data.recipes.misc.PCBFactory;
import net.minecraft.data.recipes.FinishedRecipe;

Expand All @@ -10,6 +11,7 @@ public class CMRecipes {

public static void init(Consumer<FinishedRecipe> provider) {
PCBFactory.init(provider);
CircuitFactory.init(provider);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package com.stevee.CompactMachines.data.recipes.misc;

import static com.gregtechceu.gtceu.common.data.GTItems.*;
import static com.gregtechceu.gtceu.api.GTValues.*;
import static com.gregtechceu.gtceu.api.data.tag.TagPrefix.*;
import static com.gregtechceu.gtceu.common.data.GTMaterials.*;
import static com.gregtechceu.gtceu.data.recipe.CustomTags.*;

import com.gregtechceu.gtceu.api.data.tag.TagPrefix;
import net.minecraft.data.recipes.FinishedRecipe;

import java.util.function.Consumer;

import static com.stevee.CompactMachines.common.data.CMRecipeTypes.Circuit_Factory;

public class CircuitFactory {

public static void init(Consumer<FinishedRecipe> provider) {

Circuit_Factory.recipeBuilder("microprocessor")
.inputItems(PLASTIC_CIRCUIT_BOARD, 1)
.inputItems(CENTRAL_PROCESSING_UNIT, 1)
.inputItems(RESISTORS, 2)
.inputItems(CAPACITORS, 2)
.inputItems(TRANSISTORS, 2)
.inputFluids(SolderingAlloy.getFluid(36))
.outputItems(PROCESSOR_MV, 2)
.duration(200).EUt(VA[MV]).save(provider);

Circuit_Factory.recipeBuilder("microprocessor_assembly")
.inputItems(PLASTIC_CIRCUIT_BOARD, 1)
.inputItems(PROCESSOR_MV, 1)
.inputItems(INDUCTORS, 2)
.inputItems(TRANSISTORS, 4)
.inputItems(RANDOM_ACCESS_MEMORY, 2)
.inputItems(wireFine, RedAlloy, 4)
.inputFluids(SolderingAlloy.getFluid(72))
.outputItems(PROCESSOR_ASSEMBLY_HV)
.duration(200).EUt(VA[MV]).save(provider);

Circuit_Factory.recipeBuilder("microprocessor_supercomputer")
.inputItems(PLASTIC_CIRCUIT_BOARD, 1)
.inputItems(PROCESSOR_ASSEMBLY_HV, 1)
.inputItems(DIODES, 2)
.inputItems(RANDOM_ACCESS_MEMORY, 2)
.inputItems(wireFine, Gold, 8)
.inputItems(bolt, BlueAlloy, 8)
.inputFluids(SolderingAlloy.getFluid(144))
.outputItems(WORKSTATION_EV, 1)
.duration(200).EUt(VA[MV]).save(provider);

Circuit_Factory.recipeBuilder("microprocessor_mainframe")
.inputItems(frameGt, Aluminium, 1)
.inputItems(WORKSTATION_EV, 1)
.inputItems(ADVANCED_SMD_INDUCTOR, 1)
.inputItems(ADVANCED_SMD_CAPACITOR, 2)
.inputItems(RANDOM_ACCESS_MEMORY, 8)
.inputItems(wireGtSingle, AnnealedCopper, 8)
.inputFluids(SolderingAlloy.getFluid(288))
.outputItems(MAINFRAME_IV, 1)
.duration(200).EUt(VA[HV]).save(provider);


}

}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit aae288b

Please sign in to comment.