Skip to content

Commit

Permalink
WOrks but the crafting recipe is broken
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveeTheEpic committed Jun 28, 2024
1 parent 4686ea6 commit 45aaee0
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 142 deletions.
24 changes: 13 additions & 11 deletions src/main/java/stevee/gtec/GTExtendedChem.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package stevee.gtec;

import com.gregtechceu.gtceu.api.registry.GTRegistries;
import stevee.gtec.common.data.*;
import stevee.gtec.registry.GTECCreativeModeTabs;
import stevee.gtec.registry.GTECRegistries;
Expand Down Expand Up @@ -30,6 +31,9 @@ public GTExtendedChem() {
GTExtendedChem.init();
var bus = FMLJavaModLoadingContext.get().getModEventBus();
bus.register(this);

bus.addGenericListener(GTRecipeType.class, this::registerRecipeTypes);
bus.addGenericListener(MachineDefinition.class, this::registerMachines);
}

public static void init() {
Expand All @@ -39,11 +43,19 @@ public static void init() {
GTECCompassSections.init();
GTECItems.init();
GTECCreativeModeTabs.init();
GTECMachines.init();
GTECDatagen.init();
GTECRegistries.REGISTRATE.registerRegistrate();
}

@SubscribeEvent
public void registerRecipeTypes(GTCEuAPI.RegisterEvent<ResourceLocation, GTRecipeType> event) {
GTECRecipeTypes.init();
}

@SubscribeEvent
public void registerMachines(GTCEuAPI.RegisterEvent<ResourceLocation, MachineDefinition> event) {
GTECMachines.init();
}

public static ResourceLocation id(String path) {
return new ResourceLocation(MOD_ID, path);
Expand All @@ -68,16 +80,6 @@ public void modifyMaterials(PostMaterialEvent event) {
GTECMaterials.modifyMaterials();
}

@SubscribeEvent
public void registerRecipeTypes(GTCEuAPI.RegisterEvent<ResourceLocation, GTRecipeType> event) {
GTECRecipeTypes.init();
}

@SubscribeEvent
public void registerMachines(GTCEuAPI.RegisterEvent<ResourceLocation, MachineDefinition> event) {
GTECMachines.init();
}

@SubscribeEvent
public void registerCompassSections(GTCEuAPI.RegisterEvent<ResourceLocation, CompassNode> event) {
GTECCompassSections.init();
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/stevee/gtec/block/CleanroomFilterType.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package stevee.gtec.block;

/*
import argent_matter.gtec.GTExtendedChem;

import stevee.gtec.GTExtendedChem;
import com.gregtechceu.gtceu.api.block.IFilterType;
import com.gregtechceu.gtceu.api.machine.multiblock.CleanroomType;
import org.jetbrains.annotations.NotNull;
Expand All @@ -21,4 +21,3 @@ public String getSerializedName() {
}
}

*/
11 changes: 5 additions & 6 deletions src/main/java/stevee/gtec/block/GTECBlocks.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package stevee.gtec.block;

/*
import argent_matter.gtec.GTExtendedChem;
import argent_matter.gtec.registry.GTECRegistries;
import argent_matter.util.GTECUtil;

import stevee.gtec.GTExtendedChem;
import stevee.gtec.registry.GTECRegistries;
import stevee.util.GTECUtil;
import com.gregtechceu.gtceu.api.block.ICoilType;
import com.gregtechceu.gtceu.api.block.IFilterType;
import com.gregtechceu.gtceu.api.block.RendererBlock;
Expand All @@ -28,7 +28,7 @@
import java.util.Map;
import java.util.function.Supplier;

import static argent_matter.gtec.registry.GTECRegistries.REGISTRATE;
import static stevee.gtec.registry.GTECRegistries.REGISTRATE;


@SuppressWarnings("unused")
Expand All @@ -54,4 +54,3 @@ public static void init() {
}


*/
17 changes: 17 additions & 0 deletions src/main/java/stevee/gtec/common/data/GTECBlocks.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package stevee.gtec.common.data;

import com.tterrag.registrate.util.entry.BlockEntry;
import stevee.gtec.registry.GTECCreativeModeTabs;

import static stevee.gtec.registry.GTECRegistries.REGISTRATE;

public class GTECBlocks {

static {
REGISTRATE.creativeModeTab(() -> GTECCreativeModeTabs.ITEM);
}




}
97 changes: 1 addition & 96 deletions src/main/java/stevee/gtec/common/data/GTECCompassSections.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,107 +15,12 @@

import java.util.Locale;

/**
* @author KilaBash
* @date 2023/7/31
* @implNote GTCompassSections
*/

public class GTECCompassSections {

static {
GTRegistries.COMPASS_SECTIONS.unfreeze();
}

private static int priority = 0;

public final static CompassSection INTRODUCTION = CompassSection.create("introduction")
.icon(() -> GuiTextures.GREGTECH_LOGO)
.priority(priority++)
.register();

public final static CompassSection GENERATIONS = CompassSection.create("generation")
.icon(() -> new ItemStackTexture(GTBlocks.MATERIAL_BLOCKS.get(TagPrefix.ore, GTMaterials.Silver).asStack()))
.priority(priority++)
.register();

public final static CompassSection COVERS = CompassSection.create("covers")
.icon(() -> new ItemStackTexture(GTItems.ITEM_FILTER.asStack()))
.priority(priority++)
.register();

public final static CompassSection TOOLS = CompassSection.create("tools")
.icon(() -> new ItemStackTexture(GTItems.TOOL_ITEMS.get(GTMaterials.Iron, GTToolType.WRENCH).asStack()))
.priority(priority++)
.register();

public final static CompassSection MATERIALS = CompassSection.create("materials")
.icon(() -> new ItemStackTexture(GTItems.MATERIAL_ITEMS.get(TagPrefix.gear, GTMaterials.Steel).asStack()))
.priority(priority++)
.register();

public final static CompassSection ITEMS = CompassSection.create("items")
.icon(() -> new ItemStackTexture(GTItems.SHAPE_MOLD_INGOT.asStack()))
.priority(priority++)
.register();

public final static CompassSection MISC = CompassSection.create("misc")
.icon(() -> new ItemStackTexture(GTItems.COIN_GOLD_ANCIENT.asStack()))
.priority(priority++)
.register();

public final static CompassSection CIRCUITS = CompassSection.create("circuits")
.icon(() -> new ItemStackTexture(GTItems.ELECTRONIC_CIRCUIT_LV.asStack()))
.priority(priority++)
.register();

public final static CompassSection COMPONENTS = CompassSection.create("components")
.icon(() -> new ItemStackTexture(GTItems.ELECTRIC_MOTOR_LV.asStack()))
.priority(priority++)
.register();

public final static CompassSection BATTERIES = CompassSection.create("batteries")
.icon(() -> new ItemStackTexture(GTItems.BATTERY_HV_SODIUM.asStack()))
.priority(priority++)
.register();

public final static CompassSection BLOCKS = CompassSection.create("blocks")
.icon(() -> new ItemStackTexture(GTBlocks.COIL_CUPRONICKEL.asStack()))
.priority(priority++)
.register();

public final static CompassSection MACHINES = CompassSection.create("machines")
.icon(() -> new ItemStackTexture(GTMachines.CHEMICAL_REACTOR[GTValues.LV].asStack()))
.priority(priority++)
.register();

public final static CompassSection PARTS = CompassSection.create("parts")
.icon(() -> new ItemStackTexture(GTMachines.MAINTENANCE_HATCH.asStack()))
.priority(priority++)
.register();

public final static CompassSection MULTIBLOCK = CompassSection.create("multiblock")
.icon(() -> new ItemStackTexture(GTMachines.ELECTRIC_BLAST_FURNACE.asStack()))
.priority(priority++)
.register();
public final static CompassSection STEAM = CompassSection.create("steam")
.icon(() -> new ItemStackTexture(GTMachines.STEAM_SOLID_BOILER.left().asStack()))
.lang("Steam Age")
.priority(priority++)
.register();

public final static CompassSection[] TIER = new CompassSection[10];

static {
for (int i = 0; i < 10; i++) {
int finalI = i;
TIER[i] = CompassSection.create(GTValues.VN[i].toLowerCase(Locale.ROOT))
.icon(() -> new ItemStackTexture(GTMachines.HULL[finalI].asStack()))
.background(() -> GuiTextures.DISPLAY)
.lang(GTValues.VNF[i] + " Voltage")
.priority(priority++)
.register();
}
}

public static void init() {}
}
37 changes: 22 additions & 15 deletions src/main/java/stevee/gtec/common/data/GTECMachines.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,54 +9,61 @@
import com.gregtechceu.gtceu.api.data.tag.TagPrefix;
import com.gregtechceu.gtceu.api.machine.MachineDefinition;
import com.gregtechceu.gtceu.api.machine.MultiblockMachineDefinition;
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.registry.GTRegistries;
import com.gregtechceu.gtceu.common.data.GTBlocks;
import com.gregtechceu.gtceu.common.data.GTCompassSections;
import com.gregtechceu.gtceu.common.data.GTMaterials;
import com.gregtechceu.gtceu.common.machine.multiblock.part.MufflerPartMachine;
import com.gregtechceu.gtceu.integration.kjs.GTRegistryInfo;
import com.ibm.icu.text.MessagePattern;
import net.minecraftforge.fml.ModLoader;


import java.util.Objects;

import static com.gregtechceu.gtceu.api.GTValues.LuV;
import static com.gregtechceu.gtceu.common.data.GTBlocks.CASING_STAINLESS_CLEAN;
import static stevee.gtec.registry.GTECRegistries.REGISTRATE;
import static com.gregtechceu.gtceu.api.pattern.Predicates.*;

@SuppressWarnings({"Convert2MethodRef", "FunctionalExpressionCanBeFolded", "unused"})
public class GTECMachines {

static {
GTRegistries.MACHINES.unfreeze();
}


public static final MultiblockMachineDefinition BACTERIA_BATH = REGISTRATE.multiblock("bacteria_bath", WorkableElectricMultiblockMachine::new)
.rotationState(RotationState.NON_Y_AXIS)
.appearanceBlock(GTBlocks.CASING_STAINLESS_CLEAN)
.appearanceBlock(() -> CASING_STAINLESS_CLEAN.get())
.recipeType(GTECRecipeTypes.BACTERIA_RECIPES)
.pattern(definition -> FactoryBlockPattern.start()
.aisle("GGGGG", "F F", "F F", "F F", "GGGGG")
.aisle("GGGGG", " SSS ", " SSS ", " SSS ", "GGGGG")
.aisle("GGGGG", " S S ", " S S ", " S S ", "GGMGG")
.aisle("GGGGG", " SSS ", " SSS ", " SSS ", "GGGGG")
.aisle("GGCGG", "F F", "F F", "F F", "GGGGG")
.where('G', blocks(GTBlocks.CASING_STAINLESS_CLEAN.get()).setMinGlobalLimited(40)
.or(autoAbilities(definition.getRecipeTypes()))
.where('G', blocks(CASING_STAINLESS_CLEAN.get()).setMinGlobalLimited(40)
.or(abilities(PartAbility.IMPORT_FLUIDS))
.or(abilities(PartAbility.IMPORT_ITEMS))
.or(abilities(PartAbility.EXPORT_ITEMS))
.or(abilities(PartAbility.EXPORT_FLUIDS))
.or(abilities(PartAbility.INPUT_ENERGY))
.or(autoAbilities(true, true, false)))
.where("C", controller(blocks(definition.getBlock())))
.where('C', controller(blocks(definition.getBlock())))
.where('S', blocks(GTBlocks.CASING_TEMPERED_GLASS.get()))
.where('F', blocks(ChemicalHelper.getBlock(TagPrefix.frameGt, GTMaterials.Naquadah)))
.where('F', blocks(Objects.requireNonNull(GTBlocks.MATERIAL_BLOCKS.get(TagPrefix.frameGt, GTMaterials.Naquadah)).getUnchecked()))
.where('M', abilities(PartAbility.MUFFLER))
.where(' ', any())
.build())
.workableCasingRenderer(GTCEu.id("block/casings/solid/machine_casing_solid_steel"),
GTCEu.id("block/multiblock/implosion_compressor"))
.compassSections(GTCompassSections.TIER[LuV])
.compassNodeSelf()
.register();



public static void init() {
if (GTCEu.isKubeJSLoaded()) {
GTRegistryInfo.registerFor(GTRegistries.MACHINES.getRegistryName());
}
ModLoader.get().postEvent(new GTCEuAPI.RegisterEvent<>(GTRegistries.MACHINES, MachineDefinition.class));
GTRegistries.MACHINES.freeze();
}
}
}
11 changes: 0 additions & 11 deletions src/main/java/stevee/gtec/common/data/GTECRecipeTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,12 @@

public class GTECRecipeTypes {

static {
GTRegistries.RECIPE_TYPES.unfreeze();
}


public static final GTRecipeType BACTERIA_RECIPES = register("bacteria_bath", MULTIBLOCK)
.setMaxIOSize(1, 1, 1, 1)
.setEUIO(IO.IN)
.setProgressBar(GuiTextures.PROGRESS_BAR_ARROW_MULTIPLE, ProgressTexture.FillDirection.LEFT_TO_RIGHT)
.setSound(GTSoundEntries.CHEMICAL);
public static void init() {
ModLoader.get().postEvent(new GTCEuAPI.RegisterEvent<>(GTRegistries.RECIPE_TYPES, GTRecipeType.class));
if (GTCEu.isKubeJSLoaded()) {
GTRegistryInfo.registerFor(GTRegistries.RECIPE_TYPES.getRegistryName());
}
GTRegistries.RECIPE_TYPES.freeze();

}

public static GTRecipeType register(String name, String group, RecipeType<?>... proxyRecipes) {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/stevee/gtec/common/data/GTECRecipes.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package stevee.gtec.common.data;


import stevee.gtec.data.recipe.chemistry.MiscRecipes;
import stevee.gtec.data.recipe.disabled.BastnasiteChainRecipes;
import stevee.gtec.data.recipe.disabled.MonaziteChainRecipes;
import stevee.gtec.data.recipe.disabled.PlatinumLineRecipes;
Expand All @@ -16,6 +17,7 @@ public static void init(Consumer<FinishedRecipe> provider) {
PlatinumLineRecipes.init(provider);
MonaziteChainRecipes.init(provider);
BastnasiteChainRecipes.init(provider);
MiscRecipes.init(provider);

}
}
26 changes: 26 additions & 0 deletions src/main/java/stevee/gtec/data/recipe/chemistry/MiscRecipes.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package stevee.gtec.data.recipe.chemistry;

import com.gregtechceu.gtceu.common.data.GTBlocks;
import com.gregtechceu.gtceu.common.data.GTItems;
import com.gregtechceu.gtceu.common.data.GTMachines;
import com.gregtechceu.gtceu.data.recipe.VanillaRecipeHelper;
import net.minecraft.data.recipes.FinishedRecipe;
import stevee.gtec.GTExtendedChem;
import stevee.gtec.common.data.GTECMachines;

import java.util.function.Consumer;

public class MiscRecipes {
public static void init(Consumer<FinishedRecipe> provider) {
VanillaRecipeHelper.addShapedRecipe(provider, GTExtendedChem.id("bacteria_bath"),
GTECMachines.BACTERIA_BATH.asStack(1),
"FFF",
"PMP",
"GGG",
"M", GTMachines.HULL[6].asStack(),
"F", GTBlocks.CASING_TEMPERED_GLASS.asStack(),
"P", GTItems.ELECTRIC_PUMP_LuV,
"G", GTItems.PETRI_DISH);
}

}

0 comments on commit 45aaee0

Please sign in to comment.