Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
bunch of work on hard circuits
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Aug 8, 2023
1 parent 686f241 commit 7a4c3ca
Show file tree
Hide file tree
Showing 18 changed files with 184 additions and 127 deletions.
1 change: 1 addition & 0 deletions common/src/main/java/muramasa/gregtech/GregTech.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public static void registerCraftingLoaders(CraftingEvent event) {
event.addLoader(SteamMachines::loadRecipes);
event.addLoader(BlockParts::loadRecipes);
event.addLoader(Parts::loadRecipes);
event.addLoader(Circuitry::loadCraftingRecipes);
event.addLoader(ElectricToolRecipes::loadRecipes);
event.addLoader(MaterialCrafting::loadRecipes);
event.addLoader(FurnaceLoader::loadRecipes);
Expand Down
6 changes: 6 additions & 0 deletions common/src/main/java/muramasa/gregtech/data/GregTechData.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,12 @@ public static void init(Side side) {
public static ItemBasic<?> DataOrb = new ItemBasic<>(GTIRef.ID, "data_orb");

public static ItemBasic<?> Transistor = new ItemBasic<>(GTIRef.ID, "transistor").tip("An integral part to Circuitry");
public static ItemBasic<?> SMDTransistor = new ItemBasic<>(GTIRef.ID, "smd_transistor").tip("An integral part to Circuitry");
public static ItemBasic<?> Resistor = new ItemBasic<>(GTIRef.ID, "resistor").tip("An integral part to Circuitry");
public static ItemBasic<?> SMDResistor = new ItemBasic<>(GTIRef.ID, "smd_resistor").tip("An integral part to Circuitry");
public static ItemBasic<?> Diode = new ItemBasic<>(GTIRef.ID, "diode").tip("An integral part to Circuitry");
public static ItemBasic<?> Capacitor = new ItemBasic<>(GTIRef.ID, "capacitor").tip("An integral part to Circuitry");
public static ItemBasic<?> SMDCapacitor = new ItemBasic<>(GTIRef.ID, "smd_capacitor").tip("An integral part to Circuitry");
public static ItemBasic<?> VacuumTube = new ItemBasic<>(GTIRef.ID, "vacuum_tube").tip("A part for the Basic Circuit");
public static ItemBasic<?> GlassTube = new ItemBasic<>(GTIRef.ID, "glass_tube").tip("A part for circuits");

Expand All @@ -201,6 +205,8 @@ public static void init(Side side) {
public static ItemBasic<?> SiliconChip = new ItemBasic<>(GTIRef.ID, "silicon_chip", "silicon/");
public static ItemBasic<?> GlowstoneDopedWafer = new ItemBasic<>(GTIRef.ID, "glowstone_doped_wafer", "silicon/");
public static ItemBasic<?> NaquadahDopedWafer = new ItemBasic<>(GTIRef.ID, "naquadah_doped_wafer", "silicon/");
public static ItemBasic<?> IntegratedLogicCircuitWafer = new ItemBasic<>(GTIRef.ID, "integrated_logic_circuit_wafer", "silicon/");
public static ItemBasic<?> IntegratedLogicCircuit = new ItemBasic<>(GTIRef.ID, "integrated_logic_circuit", "silicon/");

public static ItemBasic<?> BatteryTantalum = new ItemBattery(GTIRef.ID, "tantalum_capacitor", Tier.ULV, 10000, true).tip("Reusable");
public static ItemBasic<?> BatteryHullSmall = new ItemBasic<>(GTIRef.ID, "small_battery_hull").tip("An empty LV Battery Hull");
Expand Down
4 changes: 4 additions & 0 deletions common/src/main/java/muramasa/gregtech/data/GregTechTags.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package muramasa.gregtech.data;

import muramasa.antimatter.util.TagUtils;
import muramasa.gregtech.GTIRef;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;

Expand All @@ -14,6 +16,7 @@ public class GregTechTags {
public static TagKey<Item> CIRCUITS_MASTER = getTag("circuits/master");
public static TagKey<Item> CIRCUITS_DATA_ORB = getTag("circuits/data_orb");
public static TagKey<Item> DUST_LAPIS_LAZURITE = getTag("dusts/lapislazurite");
public static TagKey<Item> DUST_COALS = getTag("dusts/coals");
public static TagKey<Item> BATTERIES_RE = getTag("batteries/re");
public static TagKey<Item> BATTERIES_SMALL = getTag("batteries/small");
public static TagKey<Item> BATTERIES_MEDIUM = getTag("batteries/medium");
Expand All @@ -22,6 +25,7 @@ public class GregTechTags {
public static TagKey<Item> POWER_UNIT_MV = getTag("power_units/mv");
public static TagKey<Item> POWER_UNIT_HV = getTag("power_units/hv");
public static TagKey<Item> POWER_UNIT_SMALL = getTag("power_units/small");
public static TagKey<Item> RESISTORS = TagUtils.getItemTag(new ResourceLocation(GTIRef.ID, "resistors"));

public static TagKey<Item> getTag(String id){
return TagUtils.getForgelikeItemTag(id);
Expand Down
2 changes: 2 additions & 0 deletions common/src/main/java/muramasa/gregtech/data/Guis.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ public static void init(Side side) {
BENDER.add(ALLOY_SMELTER);
CANNER.add(IT_IN, 35, 25).add(IT_IN, 53, 25).add(IT_OUT, 107, 25).add(ENERGY, 80, 63)
.getGui().getMachineData().setProgressLocation("canner");
CIRCUIT_ASSEMBLER.add(ASSEMBLER)
.getGui().getMachineData().setProgressLocation("assembler");
COMPRESSOR.add(IT_IN, 53, 25).add(IT_OUT, 107, 25).add(ENERGY, 80, 63)
.getGui().getMachineData().setProgressLocation("compressor");
CUTTER.add(IT_IN, 53, 25).add(FL_IN, 53, 63).add(IT_OUT, 107, 25).add(IT_OUT, 125, 25).add(ENERGY, 80, 63)
Expand Down
1 change: 1 addition & 0 deletions common/src/main/java/muramasa/gregtech/data/Machines.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public class Machines {
public static BasicMachine CHEMICAL_BATH = new BasicMachine(GTIRef.ID, "chemical_bath").setMap(CHEMICAL_BATHING).addFlags(GUI, ITEM, FLUID).setSound(GregTechSounds.EXTRACTOR, 0.6f);
public static BasicMachine CHEMICAL_DEHYDRATOR = new BasicMachine(GTIRef.ID, "chemical_dehydrator").setMap(DEHYDRATING).addFlags(GUI, ITEM, FLUID);
public static BasicMachine CHEMICAL_REACTOR = new BasicMachine(GTIRef.ID, "chemical_reactor").setMap(CHEMICAL_REACTING).addFlags(GUI, ITEM, FLUID).renderContainedLiquids().custom();
public static BasicMachine CIRCUIT_ASSEMBLER = new BasicMachine(GTIRef.ID, "circuit_assembler").setMap(CIRCUIT_ASSEMBLING).addFlags(GUI, ITEM, FLUID);
public static BasicMachine COMPRESSOR = new BasicMachine(GTIRef.ID, "compressor").setMap(COMPRESSING).addFlags(GUI, ITEM);
public static BasicMachine CUTTER = new BasicMachine(GTIRef.ID, "cutter").setMap(CUTTING).addFlags(GUI, ITEM, FLUID);
public static BasicMachine DECAY_CHAMBER = new BasicMachine(GTIRef.ID, "decay_chamber").setMap(DECAYING).addFlags(GUI, ITEM, FLUID);
Expand Down
2 changes: 2 additions & 0 deletions common/src/main/java/muramasa/gregtech/data/RecipeMaps.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public class RecipeMaps {
new RecipeMap<>(GTIRef.ID, "chemical_bathing", new RecipeBuilder()));
public static RecipeMap<RecipeBuilder> CHEMICAL_REACTING = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "chemical_reacting", new RecipeBuilder()));
public static RecipeMap<RecipeBuilder> CIRCUIT_ASSEMBLING = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "circuit_assembling", new RecipeBuilder()));
public static RecipeMap<RecipeBuilder> COAL_BOILERS = AntimatterAPI.register(RecipeMap.class,
new RecipeMap<>(GTIRef.ID, "coal_boilers", new RecipeBuilder()));
public static RecipeMap<RecipeBuilder> COKING = AntimatterAPI.register(RecipeMap.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
import muramasa.antimatter.util.TagUtils;
import muramasa.gregtech.data.GregTechTags;

import static muramasa.antimatter.data.AntimatterMaterialTypes.DUST;
import static muramasa.antimatter.data.AntimatterMaterialTypes.PLATE;
import static muramasa.antimatter.data.AntimatterMaterials.*;
import static muramasa.gregtech.data.GregTechData.*;
import static muramasa.gregtech.data.GregTechTags.*;
import static muramasa.gregtech.data.Materials.*;

public class GregTechItemTagProvider extends AntimatterItemTagProvider {
public GregTechItemTagProvider(String providerDomain, String providerName, boolean replace, AntimatterBlockTagProvider p) {
Expand All @@ -31,7 +35,9 @@ protected void processTags(String domain) {
this.tag(POWER_UNIT_MV).add(PowerUnitMV);
this.tag(POWER_UNIT_HV).add(PowerUnitHV);
this.tag(POWER_UNIT_SMALL).add(SmallPowerUnit);
this.tag(PLATES_IRON_ALUMINIUM).addTag(TagUtils.getForgelikeItemTag("plates/iron")).addTag(TagUtils.getForgelikeItemTag("plates/wrought_iron")).addTag(TagUtils.getForgelikeItemTag("plates/aluminium"));
this.tag(DUST_LAPIS_LAZURITE).addTag(TagUtils.getForgelikeItemTag("dusts/lapis")).addTag(TagUtils.getForgelikeItemTag("dusts/lazurite"));
this.tag(RESISTORS).add(Resistor, SMDResistor);
this.tag(PLATES_IRON_ALUMINIUM).addTag(PLATE.getMaterialTag(Iron)).addTag(PLATE.getMaterialTag(WroughtIron)).addTag(PLATE.getMaterialTag(Aluminium));
this.tag(DUST_LAPIS_LAZURITE).addTag(DUST.getMaterialTag(Lapis)).addTag(DUST.getMaterialTag(Lazurite));
this.tag(DUST_COALS).addTag(DUST.getMaterialTag(Coal)).addTag(DUST.getMaterialTag(Charcoal)).addTag(DUST.getMaterialTag(Carbon));
}
}
81 changes: 2 additions & 79 deletions common/src/main/java/muramasa/gregtech/loader/crafting/Parts.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import muramasa.antimatter.pipe.types.Wire;
import muramasa.gregtech.GTIRef;
import muramasa.gregtech.GregTech;
import muramasa.gregtech.GregTechConfig;
import muramasa.gregtech.data.GregTechData;
import muramasa.gregtech.data.GregTechTags;
import net.minecraft.data.recipes.FinishedRecipe;
Expand All @@ -39,7 +40,6 @@
public class Parts {
public static void loadRecipes(Consumer<FinishedRecipe> output, AntimatterRecipeProvider provider) {
tieredItems(output, provider);
circuits(output, provider);
molds(output, provider);
provider.shapeless(output, "fire_clay_dust", "parts", "has_clay_dust", provider.hasSafeItem(AntimatterMaterialTypes.DUST.getMaterialTag(Clay)), AntimatterMaterialTypes.DUST.get(Fireclay, 2),
AntimatterMaterialTypes.DUST.getMaterialTag(Brick), AntimatterMaterialTypes.DUST.getMaterialTag(Clay));
Expand Down Expand Up @@ -78,13 +78,7 @@ public static void loadRecipes(Consumer<FinishedRecipe> output, AntimatterRecipe
'G', GEAR.get(CobaltBrass),
'D', DUST_SMALL.get(Diamond)
), " D ", "DGD", " D ");
// MANUAL COATED BOARD CRAFTING
provider.addStackRecipe(output, GTIRef.ID, "", "board_basic", "has_wrench", provider.hasSafeItem(WRENCH.getTag()), new ItemStack(CircuitBoardCoated, 3),
ImmutableMap.<Character, Object>builder()
.put('R', GTRubberData.StickyResin)
.put('P', PLATE.get(Wood))
.build(),
" R ", "PPP", " R ");

provider.addItemRecipe(output, "mining_pipes", "has_hammer", provider.hasSafeItem(HAMMER.getTag()), MINING_PIPE_THIN,
of('H', HAMMER.getTag(), 'P', FLUID_PIPE_STEEL.getBlockItem(PipeSize.SMALL), 'F', FILE.getTag()), "HPF");
}
Expand Down Expand Up @@ -196,77 +190,6 @@ private static void shapeRecipe(Consumer<FinishedRecipe> output, AntimatterRecip
of('P', EmptyShape, 'H', WIRE_CUTTER.getTag()), shapes);
}

private static void bloodyCircuits(Consumer<FinishedRecipe> output, AntimatterRecipeProvider provider){
// MANUAL TIER 0 CIRCUIT CRAFTING
provider.addItemRecipe(output, "circuit_basic", "has_wrench", provider.hasSafeItem(WRENCH.getTag()), CircuitBasicIntegrated,
ImmutableMap.<Character, Object>builder()
.put('V', VacuumTube).put('B', CircuitBoardCoated)
.put('W',
AntimatterAPI.getOrThrow(Cable.class, "cable_" + RedAlloy.getId(),
() -> new RuntimeException("Missing red alloy cable")).getBlockItem(PipeSize.VTINY))
.put('C',
AntimatterAPI.getOrThrow(Cable.class, "cable_" + Tin.getId(),
() -> new RuntimeException("Missing tin cable")).getBlockItem(PipeSize.VTINY))
.put('R',Resistor).put('P', PLATE.get(Steel))
.build(),
"RPR", "VBV", "CWC");

// MANUAL VAC TUBE CRAFTING
provider.addItemRecipe(output, "vac_tube", "has_wrench", provider.hasSafeItem(WRENCH.getTag()), VacuumTube,
ImmutableMap.<Character, Object>builder()
.put('G', Items.GLASS)
.put('P', Items.PAPER)
.put('W',
AntimatterAPI.getOrThrow(Wire.class, "wire_" + Copper.getId(),
() -> new RuntimeException("Missing copper wire")).getBlockItem(PipeSize.VTINY))
.build(),
" ", "PGP", "WWW");

// MANUAL RESISTOR CRAFTING
provider.addItemRecipe(output, "resistor", "has_wrench", provider.hasSafeItem(WRENCH.getTag()), Resistor,
ImmutableMap.<Character, Object>builder()
.put('C', DUST.get(Coal))
.put('P', Items.PAPER)
.put('W',
AntimatterAPI.getOrThrow(Wire.class, "wire_" + Copper.getId(),
() -> new RuntimeException("Missing copper wire")).getBlockItem(PipeSize.VTINY))
.build(),
" P ", "WCW", " P ");
}

private static void circuits(Consumer<FinishedRecipe> output, AntimatterRecipeProvider provider){
provider.addItemRecipe(output, GTIRef.ID, "circuit_basic_copper_h", "circuits", "has_copper_cable", provider.hasSafeItem((TagKey<Item>) CABLE_GETTER.apply(PipeSize.VTINY, MV, false)), CircuitBasicElectronic,
ImmutableMap.<Character, Object>builder()
.put('C', CABLE_GETTER.apply(PipeSize.VTINY, MV, false))
.put('N', NandChip)
.put('S', CircuitBoardCoated)
.build(), "CCC", "NSN", "CCC");
provider.addItemRecipe(output, GTIRef.ID, "circuit_basic_copper_v", "circuits", "has_copper_cable", provider.hasSafeItem((TagKey<Item>) CABLE_GETTER.apply(PipeSize.VTINY, MV, false)), CircuitBasicElectronic,
ImmutableMap.<Character, Object>builder()
.put('C', CABLE_GETTER.apply(PipeSize.VTINY, MV, false))
.put('N', NandChip)
.put('S', CircuitBoardCoated)
.build(), "CNC", "CSC", "CNC");
provider.addItemRecipe(output, GTIRef.ID, "circuit_basic_red_alloy_h", "circuits", "has_red_alloy_cable", provider.hasSafeItem(CABLE_RED_ALLOY.getBlockItem(PipeSize.VTINY)), CircuitBasicElectronic,
ImmutableMap.<Character, Object>builder()
.put('C', CABLE_RED_ALLOY.getBlockItem(PipeSize.VTINY))
.put('N', NandChip)
.put('S', CircuitBoardCoated)
.build(), "CCC", "NSN", "CCC");
provider.addItemRecipe(output, GTIRef.ID, "circuit_basic_red_alloy_v", "circuits", "has_red_alloy_cable", provider.hasSafeItem(CABLE_RED_ALLOY.getBlockItem(PipeSize.VTINY)), CircuitBasicElectronic,
ImmutableMap.<Character, Object>builder()
.put('C', CABLE_RED_ALLOY.getBlockItem(PipeSize.VTINY))
.put('N', NandChip)
.put('S', CircuitBoardCoated)
.build(), "CNC", "CSC", "CNC");
provider.addItemRecipe(output, GTIRef.ID, "", "circuits", "has_item_casing", provider.hasSafeItem(ITEM_CASING.getMaterialTag(Steel)), NandChip,
of('C', ITEM_CASING.getMaterialTag(Steel), 'R', WIRE_RED_ALLOY.getBlockItem(PipeSize.VTINY), 'T', WIRE_GETTER.apply(PipeSize.VTINY, LV)), "CR", "RT");
provider.addItemRecipe(output, GTIRef.ID, "lapotron_crystal_upgrade", "energy_orbs", "has_circuit", provider.hasSafeItem(CIRCUITS_ADVANCED), LapotronCrystal,
of('C', CIRCUITS_ADVANCED, 'L', GregTechTags.DUST_LAPIS_LAZURITE, 'E', EnergyCrystal), "LCL", "LEL", "LCL");
provider.addItemRecipe(output, GTIRef.ID, "", "energy_orbs", "has_circuit", provider.hasSafeItem(CIRCUITS_ADVANCED), LapotronCrystal,
of('C', CIRCUITS_ADVANCED, 'L', GregTechTags.DUST_LAPIS_LAZURITE, 'S', GEM.getMaterialTag(Sapphire)), "LCL", "LSL", "LCL");
}

static PipeSize fromTier(Tier tier){
if (tier == LV) return PipeSize.VTINY;
if (tier == MV) return PipeSize.TINY;
Expand Down
Loading

0 comments on commit 7a4c3ca

Please sign in to comment.