### Recipe Pool Interface and Implementation (Java) Source: https://context7.com/callmeshaobe/123technology/llms.txt Defines the IRecipePool interface for loading recipes and provides an example implementation (RecipesMegaQFT) for creating a uranium enrichment recipe. It also includes a RecipeLoader class to initialize all recipe pools. ```java public interface IRecipePool { void loadRecipes(); } public class RecipesMegaQFT implements IRecipePool { @Override public void loadRecipes() { Fluid H2 = FluidRegistry.getFluid("hydrogen"); final RecipeMap MQFT = Recipemaps.QFTMega; GTValues.RA.stdBuilder() .itemInputs( GTUtility.getIntegratedCircuit(1), GTOreDictUnificator.get(OrePrefixes.dust, Materials.Uranium, 64), GTOreDictUnificator.get(OrePrefixes.dust, Materials.Thorium, 64)) .itemOutputs( GTOreDictUnificator.get(OrePrefixes.dust, Materials.Uranium235, 64), GTOreDictUnificator.get(OrePrefixes.dust, Materials.Plutonium241, 64), GTOreDictUnificator.get(OrePrefixes.dust, Materials.Plutonium, 64)) .duration(200 * 20) .eut(TierEU.UIV) .addTo(MQFT); } } public class RecipeLoader { public static void loadRecipes() { IRecipePool[] recipePools = new IRecipePool[] { new RecipesComponentAssemblyLineRecipes(), new RecipesBlastFurnaceRecipes(), new RecipesMegaQFT(), new RecipesSINOPEC(), new RecipesTangshanSteelFactory(), new RecipesEIO() }; for (IRecipePool recipePool : recipePools) { recipePool.loadRecipes(); } } } ``` -------------------------------- ### Multiblock Machine Base Class Implementation (Java) Source: https://context7.com/callmeshaobe/123technology/llms.txt Demonstrates extending OTHMultiMachineBase for custom multiblock machines. It includes configurations for overclocking, parallel processing, and structure validation. Dependencies include OTHMultiMachineBase and GregTech's RecipeMap. ```java public class OTEMegaQFT extends OTHMultiMachineBase { private int stabilisationFieldMetadata = 0; private int spacetimeCompressionFieldMetadata = 0; private int timeAccelerationFieldMetadata = 0; private int multiplier = 1; @Override protected boolean isEnablePerfectOverclock() { return true; } public int getMaxParallelRecipes() { return Integer.MAX_VALUE; } protected float getSpeedBonus() { return (float) (1 - (timeAccelerationFieldMetadata * 0.1)); } private void checkMultiplier() { if (stabilisationFieldMetadata < 6) { multiplier = 1; } else if (stabilisationFieldMetadata >= 6 && stabilisationFieldMetadata <= 8) { multiplier = 2; } else if (stabilisationFieldMetadata > 8) { multiplier = 3; } } @Override public RecipeMap getRecipeMap() { return Recipemaps.QFTMega; } @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { repairMachine(); return checkPiece(STRUCTURE_PIECE_MAIN, horizontalOffSet, verticalOffSet, depthOffSet); } } ``` -------------------------------- ### Create Recipes with RecipeBuilder API (Java) Source: https://context7.com/callmeshaobe/123technology/llms.txt Demonstrates how to use the RecipeBuilder utility for creating complex recipes. It supports item and fluid inputs/outputs, EU/t consumption, and duration. This utility is part of the OTHTech library. ```java // RecipeBuilder.java - Fluent Recipe Creation import com.newmaa.othtech.utils.RecipeBuilder; import gregtech.api.enums.TierEU; // Example: Create a Mega QFT recipe for plastic production RecipeBuilder.builder() .itemInputs( GTUtility.getIntegratedCircuit(1), GTOreDictUnificator.get(OrePrefixes.dust, Materials.Carbon, 64) ) .fluidInputs( new FluidStack(FluidRegistry.getFluid("fluorine"), 64000), new FluidStack(FluidRegistry.getFluid("hydrogen"), 64000), new FluidStack(FluidRegistry.getFluid("oxygen"), 64000), new FluidStack(FluidRegistry.getFluid("chlorine"), 64000) ) .fluidOutputs( new FluidStack(FluidRegistry.getFluidID("molten.silicone"), 256 * 144), new FluidStack(FluidRegistry.getFluidID("molten.polybenzimidazole"), 256 * 144), new FluidStack(FluidRegistry.getFluidID("molten.polyvinylchloride"), 256 * 144), new FluidStack(FluidRegistry.getFluidID("molten.polytetrafluoroethylene"), 256 * 144) ) .duration(200 * 20) // 200 seconds = 4000 ticks .eut(TierEU.UHV) // UHV voltage tier .addTo(Recipemaps.QFTMega); // Example: Rare earth processing recipe GTValues.RA.stdBuilder() .itemInputs( GTUtility.getIntegratedCircuit(1), GTOreDictUnificator.get(OrePrefixes.dust, Materials.Monazite, 8), GTOreDictUnificator.get(OrePrefixes.dust, Materials.Bastnasite, 8) ) .itemOutputs( GTOreDictUnificator.get(OrePrefixes.dust, Materials.Cerium, 64), GTOreDictUnificator.get(OrePrefixes.dust, Materials.Samarium, 64), GTOreDictUnificator.get(OrePrefixes.dust, Materials.Gadolinium, 64), GTOreDictUnificator.get(OrePrefixes.dust, Materials.Holmium, 32) ) .duration(200 * 20) .eut(TierEU.UIV) .addTo(Recipemaps.QFTMega); ``` -------------------------------- ### Define Custom Recipe Maps for Machines (Java) Source: https://context7.com/callmeshaobe/123technology/llms.txt Illustrates the creation of custom `RecipeMap` instances for various 123Technology machines using `RecipeMapBuilder`. This system defines input/output capacities, progress bar styles, and NEI integration for each machine's crafting recipes. ```java import gregtech.api.recipe.RecipeMap; import gregtech.api.recipe.RecipeMapBuilder; public class Recipemaps { // Mega QFT Recipe Map - 8 inputs/outputs for items and fluids public static final RecipeMap QFTMega = RecipeMapBuilder .of("otht.recipe.OTEMegaQFT", OTH_RecipeMapBackend::new) .maxIO(8, 8, 8, 8) // maxItemIn, maxItemOut, maxFluidIn, maxFluidOut .progressBar(GTUITextures.PROGRESSBAR_ARROW_MULTIPLE) .frontend(OTH_GeneralFrontend::new) .neiHandlerInfo(builder -> builder .setDisplayStack(ItemList.Field_Generator_MAX.get(1)) .setMaxRecipesPerPage(2)) .build(); // SINOPEC Recipe Map - High fluid throughput public static final RecipeMap SINOPEC = RecipeMapBuilder .of("otht.recipe.SINOPEC", OTH_RecipeMapBackend::new) .maxIO(8, 8, 16, 16) .progressBar(GTUITextures.PROGRESSBAR_ARROW_MULTIPLE) .frontend(OTH_GeneralFrontend::new) .build(); // Tangshan Steel Factory - High item throughput public static final RecipeMap TSSF = RecipeMapBuilder .of("otht.recipe.TSSF", OTH_RecipeMapBackend::new) .maxIO(24, 24, 4, 4) .neiSpecialInfoFormatter(HeatingCoilSpecialValueFormatter.INSTANCE) .frontend(OTH_GeneralFrontend::new) .build(); // Naquadah Fuel Recipes public static final RecipeMap NaquadahFuelFakeRecipes = RecipeMapBuilder .of("otht.recipe.fuel.nq", FuelBackend::new) .maxIO(0, 0, 1, 1) .minInputs(0, 1) .neiSpecialInfoFormatter(new SimpleSpecialValueFormatter("value.naquadah_reactor")) .build(); } ``` -------------------------------- ### Configuration System for Mod Settings (Java) Source: https://context7.com/callmeshaobe/123technology/llms.txt Manages runtime configuration options for the mod, including machine behavior, recipe availability, and special effects. It uses Forge's Configuration class to read and save settings from a file. ```java import net.minecraftforge.common.config.Configuration; import java.io.File; public class Config { public static boolean is_TT_Boom = true; public static boolean NEIFrontend = true; public static boolean is_MISA_IMBA_Recipes_Enabled = true; public static boolean is_EggMachine_Recipes_For_NHU = true; public static float ENQING_MULTI = 1.5f; public static int tier_Antimonia = 4; public static int tier_Ross123b = 1; public static boolean is_Enqing_Song_Play = true; public static void synchronizeConfiguration(File configFile) { Configuration configuration = new Configuration(configFile); is_TT_Boom = configuration.getBoolean( "OTHTechnology : Control TT machine explosion", "Settings", is_TT_Boom, "Enable/disable explosions"); ENQING_MULTI = configuration.getFloat( "OTHTechnology : Enqing Factory output multiplier", "Settings", 1.5f, 1.0f, 114514f, "Output multiplier"); if (configuration.hasChanged()) { configuration.save(); } } } ``` -------------------------------- ### Implement Custom Recipes with IRecipePool Source: https://context7.com/callmeshaobe/123technology/llms.txt Developers can extend 123Technology by implementing the IRecipePool interface to add custom recipes. This allows for flexible integration of new processing logic into the mod's framework. ```java package com.example; import gregtech.api.recipes.RecipeMaps; import gregtech.api.recipes.RecipeBuilder; import gregtech.api.recipes.ingredients.GTRecipeIngredient; import gregtech.api.recipes.output.GTRecipeOutput; import gregtech.api.unification.material.Material; import gregtech.api.unification.ore.OrePrefix; import java.util.function.Consumer; public class CustomRecipePool implements gregtech.api.recipes.IRecipePool { @Override public void recipeBuilder(Consumer> consumer) { // Example: Adding a simple recipe consumer.accept(RecipeMaps.ASSEMBLER_RECIPES.recipeBuilder() .input(OrePrefix.ingot, Material.IRON, 2) .output(OrePrefix.plate, Material.STEEL, 1) .duration(20) // Ticks .EUt(16)); // EU/t } } ``` -------------------------------- ### NEI Recipe Catalyst Registration (Java) Source: https://context7.com/callmeshaobe/123technology/llms.txt Registers NEI catalysts to link machines and their respective recipe maps for in-game recipe viewing. It uses FMLInterModComms to send catalyst information to NEI. Dependencies include FMLInterModComms and NBTTagCompound. ```java import cpw.mods.fml.common.event.FMLInterModComms; public class NEIRecipeMaps { public static void IMCSender() { sendCatalyst("otht.recipe.COC", "gregtech:gt.blockmachines:23539"); sendCatalyst("otht.recipe.MCA", "gregtech:gt.blockmachines:23549"); sendCatalyst("bw.recipe.cal", "gregtech:gt.blockmachines:23549"); sendCatalyst("otht.recipe.RCY", "gregtech:gt.blockmachines:23519"); sendCatalyst("mobsinfo.mobhandler", "gregtech:gt.blockmachines:23536"); } private static void sendCatalyst(String handlerID, String itemName, int priority) { NBTTagCompound aNBT = new NBTTagCompound(); aNBT.setString("handlerID", handlerID); aNBT.setString("itemName", itemName); aNBT.setInteger("priority", priority); FMLInterModComms.sendMessage("NotEnoughItems", "registerCatalystInfo", aNBT); } } ``` -------------------------------- ### Space Pumping Module Recipe Registration (Java) Source: https://context7.com/callmeshaobe/123technology/llms.txt Registers custom space pumping recipes for the Space Elevator's T4 Space Pumping Module. It maps celestial body IDs and orbit levels to specific fluid stacks. Also registers the pump module as an NEI catalyst. Dependencies include FMLPostInitializationEvent, SpacePumpingRecipes, FluidRegistry, and API. ```java import gtnhintergalactic.recipe.SpacePumpingRecipes; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import gregtech.api.util.GT_Utility.API; @Mod.EventHandler public void postInit(FMLPostInitializationEvent event) { SpacePumpingRecipes.RECIPES.put( Pair.of(2, 2), FluidRegistry.getFluidStack("lava", 1792000)); SpacePumpingRecipes.RECIPES.put( Pair.of(2, 3), FluidRegistry.getFluidStack("cryotheum", 1792000)); SpacePumpingRecipes.RECIPES.put( Pair.of(2, 4), FluidRegistry.getFluidStack("pyrotheum", 1792000)); SpacePumpingRecipes.RECIPES.put( Pair.of(2, 5), FluidRegistry.getFluidStack("liquiddna", 1792000)); SpacePumpingRecipes.RECIPES.put( Pair.of(2, 6), FluidRegistry.getFluidStack("chlorine", 1230000)); API.addRecipeCatalyst( SpaceElevatorModulePumpT4.getInternalStack_unsafe(), "gtnhintergalactic.nei.SpacePumpModuleRecipeHandler"); } ``` -------------------------------- ### Define Custom Bee Species with Forestry API (Java) Source: https://context7.com/callmeshaobe/123technology/llms.txt Shows how to define custom bee species using the Forestry API integration. This includes setting product outputs, special items, environmental conditions, and mutation requirements. The OTHBeeDefinition enum manages these definitions. ```java // OTHBeeDefinition.java - Custom Bee Species Definition public enum OTHBeeDefinition implements IBeeDefinition { // Weiwei Bee - Produces special items WEIWEI(OTHBranchDefinition.OTHBYDS, "Weiwei", true, new Color(0xE21818), new Color(0xE21818), beeSpecies -> { beeSpecies.addProduct(new ItemStack(Blocks.dirt, 1), 0.114514f); beeSpecies.addSpecialty(OTHItemList.Zhangww.get(1), 0.05f); beeSpecies.setHumidity(DAMP); beeSpecies.setTemperature(EnumTemperature.NORMAL); }, template -> { AlleleHelper.instance.set(template, FLOWERING, EnumAllele.Flowering.FASTEST); AlleleHelper.instance.set(template, EFFECT, getEffect(EXTRABEES, "teleport")); }, dis -> { IBeeMutationCustom tMutation = dis.registerMutation( getSpecies(EXTRABEES, "chad"), WALRUS.getSpecies(), 2); tMutation.requireResource(GregTechAPI.sBlockMachines, 23520); // Mega 9in1 }), // Hypogen Bee - Produces hypogen combs HYP(OTHBranchDefinition.OTHBYDS, "Hypogen", true, new Color(0xD31010), new Color(0xB01E0B), beeSpecies -> { beeSpecies.addSpecialty(OTHBeeyonds.combs.getStackForType(OTHCombTypes.HYPOGEN), 0.02F); beeSpecies.setHumidity(DAMP); beeSpecies.setTemperature(EnumTemperature.NORMAL); }, template -> { AlleleHelper.instance.set(template, FLOWERING, EnumAllele.Flowering.FASTEST); }, dis -> { IBeeMutationCustom tMutation = dis.registerMutation( INFINITY.getSpecies(), DRAGONESSENCE.getSpecies(), 1); tMutation.requireResource( Block.getBlockFromName(GoodGenerator.ID + ":componentAssemblylineCasing"), 10); }); // Initialize all bees during mod loading public static void initBees() { for (OTHBeeDefinition bee : values()) { bee.init(); } for (OTHBeeDefinition bee : values()) { bee.registerMutations(); } } } ``` -------------------------------- ### Extend Multiblock Machines with OTHMultiMachineBase Source: https://context7.com/callmeshaobe/123technology/llms.txt To create new multiblock machines within 123Technology, developers can extend the OTHMultiMachineBase class. This provides the foundational structure for defining and managing complex multiblock structures. ```java package com.example; import com.gregtech.api.capability.impl.multiblock.OTHMultiMachineBase; import gregtech.api.metatileentity.MetaTileEntity; public class CustomMultiMachine extends OTHMultiMachineBase { public CustomMultiMachine(int id) { super(id); } @Override public MetaTileEntity createMetaTileEntity(int tier) { // Return an instance of your custom multiblock machine return new MyCustomMultiBlockTileEntity(this.metaTileEntityId); } // Add your custom machine logic here } ``` -------------------------------- ### Register 123Technology Machines with MachineLoader (Java) Source: https://context7.com/callmeshaobe/123technology/llms.txt Demonstrates how the MachineLoader class registers custom multiblock machines and components for the 123Technology mod during Minecraft mod initialization. It assigns unique IDs and names to each registered machine, integrating them into the GregTech machine system. ```java import com.newmaa.othtech.common.OTHItemList; import com.newmaa.othtech.machine.*; public class MachineLoader { public static void loadMachines() { final int IDs = 23520; // Base ID for 123Technology machines // Register Mega 9-in-1 multiblock OTHItemList.NineInOne.set( new OTEMegaNineInOne(IDs, "Mega9in1", translateToLocal("ote.tn.mnio")) ); // Register Mega ISA Forge OTHItemList.MegaIsaForge.set( new OTEMegaIsaForge(IDs + 1, "MegaISAForge", translateToLocal("ote.tn.mifo")) ); // Register Mega QFT (Quantum Field Transformer) OTHItemList.Mega_QFT.set( new OTEMegaQFT(IDs + 6, "OTEMegaQFT", translateToLocal("ote.tn.mqft")) ); // Register SINOPEC petrochemical processor OTHItemList.SINOPECd.set( new OTESINOPEC(IDs + 13, "SINOPEC", translateToLocal("ote.tn.sinopec")) ); // Register Tangshan Steel Factory OTHItemList.SF.set( new OTETangShanSteelFactory(IDs + 15, "TangshanSteelFactory", translateToLocal("ote.tn.ts")) ); // Register Wireless Energy Hatches OTHItemList.inf_WirelessHatch.set( new MTEHatchWirelessMulti(IDs + 2, "infWirelessEnergyHatch", translateToLocal("ote.tn.inf"), 14, 2147483647) ); } } ```