### GrandAssemblyLine Recipe Example - Java Source: https://context7.com/abkqpo/gt-not-leisure/llms.txt Demonstrates how to define a recipe for the GrandAssemblyLine, supporting unordered item and fluid inputs, and specifying output, duration, and energy requirements. This machine is designed for massive parallel processing and advanced features like wireless mode. ```java // Machine features: // - Supports unordered recipe inputs (items don't need specific slots) // - Cross-recipe parallel processing (multiple different recipes simultaneously) // - Wireless mode with UMV+ parallel cores (no energy hatches needed) // - Perfect overclock at tier 11+ (4x speed per OC instead of 2x) // - Configurable minimum recipe time via GUI // Structure: 48x5x5 blocks using TecTech casings // Recipe example using the machine GTValues.RA.stdBuilder() .itemInputs( ItemList.Circuit_Chip_NPIC.get(64), GTOreDictUnificator.get(OrePrefixes.wireGt16, Materials.SuperconductorUMV, 64), GTOreDictUnificator.get(OrePrefixes.plate, Materials.CosmicNeutronium, 32) ) .fluidInputs( Materials.SolderingAlloy.getMolten(144000), Materials.Lubricant.getFluid(32000) ) .itemOutputs(GTNLItemList.AdvancedComponent.get(1)) .duration(6000) .eut(TierEU.RECIPE_UMV) .addTo(RecipeMaps.assemblylineVisualRecipes); // Parallel tier determines capabilities: // Tier 1-8: Standard processing with energy hatches // Tier 9-11: Enhanced overclock (4x speed) // Tier 12+: Wireless mode enabled, no energy hatches required ``` -------------------------------- ### Registering Recipes with IRecipePool in Java Source: https://context7.com/abkqpo/gt-not-leisure/llms.txt The IRecipePool interface provides a standardized method for registering custom recipes during the mod's loading phase. Implementations are called by the RecipeLoader. This example shows how to register an assembler recipe using GregTech's recipe builder. ```java package com.science.gtnl.api; public interface IRecipePool { /** * Called at RecipeLoader during server start * Implement this method to register all recipes for your machine */ void loadRecipes(); } // Example implementation for custom recipes public class MyCustomRecipes implements IRecipePool { @Override public void loadRecipes() { // Register recipes using GregTech recipe maps GTValues.RA.stdBuilder() .itemInputs(new ItemStack(Items.iron_ingot, 4)) .itemOutputs(new ItemStack(MyItems.customOutput, 1)) .duration(200) .eut(480) .addTo(RecipeMaps.assemblerRecipes); } } ``` -------------------------------- ### Implementing Wireless Power with IWirelessEnergy in Java Source: https://context7.com/abkqpo/gt-not-leisure/llms.txt The IWirelessEnergy interface allows multiblock machines to operate in wireless mode, drawing power from a global network without needing physical Energy Hatches. This example demonstrates checking for wireless upgrades, setting wireless mode, and drawing energy from the global network. ```java package com.science.gtnl.api; public interface IWirelessEnergy { // Check if wireless upgrade is installed boolean isWirelessUpgrade(); // Set the wireless upgrade state void setWirelessUpgrade(boolean upgrade); // Enable or disable wireless mode operation void setWirelessMode(boolean wirelessMode); } // Example usage in a multiblock machine public class MyWirelessMachine extends MultiMachineBase implements IWirelessEnergy { private boolean wirelessMode = false; private boolean wirelessUpgrade = false; private UUID ownerUUID; @Override public boolean isWirelessUpgrade() { return wirelessUpgrade; } @Override public void setWirelessUpgrade(boolean upgrade) { this.wirelessUpgrade = upgrade; } @Override public void setWirelessMode(boolean wirelessMode) { this.wirelessMode = wirelessMode; } @Override public CheckRecipeResult checkProcessing() { if (wirelessMode) { // Draw energy from wireless network BigInteger energyNeeded = BigInteger.valueOf(requiredEU); if (addEUToGlobalEnergyMap(ownerUUID, energyNeeded.negate())) { // Process recipe return CheckRecipeResultRegistry.SUCCESSFUL; } return CheckRecipeResultRegistry.insufficientPower(requiredEU); } // Normal energy hatch processing return super.checkProcessing(); } } ``` -------------------------------- ### Server Tickrate Control Command - Bash Source: https://context7.com/abkqpo/gt-not-leisure/llms.txt Provides examples of using the /tickrate command to control the game's tick rate on a server. It covers setting tickrates for the server, clients, specific players, and map-saved configurations, as well as freezing and unfreezing game time. ```bash # Show current tickrate /tickrate # Set tickrate for server and all clients /tickrate 20 # Set tickrate for server only /tickrate 20 server # Set tickrate for all clients /tickrate 20 client # Set tickrate for specific player /tickrate 20 PlayerName # Set map-saved tickrate (persists across restarts) /tickrate setmap 20 # Set map tickrate without immediately applying /tickrate setmap 20 --dontupdate # Freeze/unfreeze game time /tickrate freeze # Aliases: /ticks, /trc, /settickrate ``` -------------------------------- ### Register Recipes using IRecipePool Interface (Java) Source: https://context7.com/abkqpo/gt-not-leisure/llms.txt GTNL employs a pool-based system for recipe registration, loading recipes during server startup. Developers can implement the IRecipePool interface to define custom recipe pools and register them with the system. This example shows the initialization of various recipe pools and a custom pool for the Grand Assembly Line. ```java // All recipe pools are registered in RecipeLoader.loadServerStart() IRecipePool[] recipePools = new IRecipePool[] { new ChemicalRecipes(), new ElectrolyzerRecipes(), new MixerRecipes(), new AssemblerRecipes(), new ReFusionReactorRecipes(), new RealArtificialStarRecipes(), // ... 100+ recipe pools }; for (IRecipePool recipePool : recipePools) { recipePool.loadRecipes(); } // Example custom recipe pool public class CustomRecipePool implements IRecipePool { @Override public void loadRecipes() { // Grand Assembly Line special recipe GTValues.RA.stdBuilder() .itemInputs( GTNLItemList.ParallelControlCore_UMV.get(1), ItemList.Circuit_Chip_NPIC.get(64) ) .fluidInputs(Materials.Neutronium.getMolten(1440)) .itemOutputs(GTNLItemList.WirelessUpgrade.get(1)) .duration(12000) .eut(TierEU.RECIPE_UMV) .addTo(GTNLRecipeMaps.GrandAssemblyLineSpecialRecipes); } } ``` -------------------------------- ### IControllerUpgrade Interface for Machine Upgrades (Java) Source: https://context7.com/abkqpo/gt-not-leisure/llms.txt Defines a framework for implementing upgrade systems in multiblock controllers. It includes methods for managing upgrade items, costs, UI integration, and NBT persistence. Dependencies include ItemStack, ItemStackHandler, and NBTTagCompound. ```Java package com.science.gtnl.api; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.items.ItemStackHandler; public interface IControllerUpgrade { int UPGRADE_WINDOW_ID = 11; // Get required items for upgrade ItemStack[] getUpgradeRequiredItems(); // Get currently stored upgrade items ItemStack[] getStoredUpgradeWindowItems(); // Get costs already paid for each upgrade slot int[] getUpgradePaidCosts(); // Get the input slot handler for upgrade materials ItemStackHandler getUpgradeInputSlotHandler(); // Check if upgrade has been consumed/activated boolean isUpgradeConsumed(); void setUpgradeConsumed(boolean consumed); // Save/load upgrade data to NBT default void saveUpgradeNBTData(NBTTagCompound aNBT) { // Saves upgrade window storage and paid costs } default void loadUpgradeNBTData(NBTTagCompound aNBT) { // Loads upgrade window storage and paid costs } } ``` ```Java // Example implementation public class UpgradeableMachine extends MultiMachineBase implements IControllerUpgrade { private ItemStack[] storedUpgradeItems = new ItemStack[4]; private int[] upgradePaidCosts = new int[2]; private boolean upgradeConsumed = false; private ItemStackHandler upgradeHandler = new ItemStackHandler(4); @Override public ItemStack[] getUpgradeRequiredItems() { return new ItemStack[] { GTOreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 64), GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UMV, 16) }; } @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext ctx) { super.addUIWidgets(builder, ctx); createUpgradeButton(builder, ctx); // Adds upgrade button to GUI } } ``` -------------------------------- ### IRecipePool - Recipe Registration Interface Source: https://context7.com/abkqpo/gt-not-leisure/llms.txt The IRecipePool interface allows for standardized registration of recipes during the mod's loading phase. Implement this interface to define custom recipes for your machines. ```APIDOC ## IRecipePool - Recipe Registration Interface ### Description Provides a standardized way to register recipes during the mod's loading phase. All recipe pools implement this interface and are called by the `RecipeLoader` during server initialization. ### Method `loadRecipes()` ### Parameters None ### Request Example ```java package com.science.gtnl.api; import net.minecraft.item.ItemStack; import gregtech.api.recipes.RecipeMaps; import gregtech.api.util.GTValues; public class MyCustomRecipes implements IRecipePool { @Override public void loadRecipes() { // Register recipes using GregTech recipe maps GTValues.RA.stdBuilder() .itemInputs(new ItemStack(Items.iron_ingot, 4)) .itemOutputs(new ItemStack(MyItems.customOutput, 1)) .duration(200) .eut(480) .addTo(RecipeMaps.assemblerRecipes); } } ``` ### Response This interface does not have a direct response in terms of HTTP. Its effect is the registration of recipes within the game. ``` -------------------------------- ### IControllerUpgrade - Machine Upgrade System Source: https://context7.com/abkqpo/gt-not-leisure/llms.txt Provides a framework for implementing upgrade systems in multiblock controllers, including UI components and NBT persistence. ```APIDOC ## Interface IControllerUpgrade ### Description Provides a framework for implementing upgrade systems in multiblock controllers, including UI components and NBT persistence. ### Methods - **getUpgradeRequiredItems()**: Returns an array of `ItemStack` representing the items required for an upgrade. - **getStoredUpgradeWindowItems()**: Returns an array of `ItemStack` representing the items currently stored in the upgrade window. - **getUpgradePaidCosts()**: Returns an array of integers representing the costs already paid for each upgrade slot. - **getUpgradeInputSlotHandler()**: Returns the `ItemStackHandler` for the upgrade material input slot. - **isUpgradeConsumed()**: Checks if the upgrade has been consumed or activated. - **setUpgradeConsumed(boolean consumed)**: Sets the consumed status of the upgrade. - **saveUpgradeNBTData(NBTTagCompound aNBT)**: Saves upgrade window storage and paid costs to NBT. - **loadUpgradeNBTData(NBTTagCompound aNBT)**: Loads upgrade window storage and paid costs from NBT. ### Example Implementation (UpgradeableMachine) ```java public class UpgradeableMachine extends MultiMachineBase implements IControllerUpgrade { // ... implementation details ... @Override public ItemStack[] getUpgradeRequiredItems() { return new ItemStack[] { GTOreDictUnificator.get(OrePrefixes.plate, Materials.Neutronium, 64), GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UMV, 16) }; } @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext ctx) { super.addUIWidgets(builder, ctx); createUpgradeButton(builder, ctx); // Adds upgrade button to GUI } } ``` ``` -------------------------------- ### IWirelessEnergy - Wireless Power Interface Source: https://context7.com/abkqpo/gt-not-leisure/llms.txt The IWirelessEnergy interface enables multiblock machines to operate in wireless mode, drawing power from a global energy network without requiring physical Energy Hatches. ```APIDOC ## IWirelessEnergy - Wireless Power Interface ### Description Enables multiblock machines to operate in wireless mode, drawing power from a global energy network instead of requiring physical Energy Hatches. ### Methods - `isWirelessUpgrade()`: Checks if the wireless upgrade is installed. - `setWirelessUpgrade(boolean upgrade)`: Sets the wireless upgrade state. - `setWirelessMode(boolean wirelessMode)`: Enables or disables wireless mode operation. ### Parameters None directly for the interface methods, but implementation details like `ownerUUID` and energy management are handled internally. ### Request Example ```java package com.science.gtnl.api; import java.util.UUID; import java.math.BigInteger; public class MyWirelessMachine extends MultiMachineBase implements IWirelessEnergy { private boolean wirelessMode = false; private boolean wirelessUpgrade = false; private UUID ownerUUID; private int requiredEU; @Override public boolean isWirelessUpgrade() { return wirelessUpgrade; } @Override public void setWirelessUpgrade(boolean upgrade) { this.wirelessUpgrade = upgrade; } @Override public void setWirelessMode(boolean wirelessMode) { this.wirelessMode = wirelessMode; } @Override public CheckRecipeResult checkProcessing() { if (wirelessMode) { // Draw energy from wireless network BigInteger energyNeeded = BigInteger.valueOf(requiredEU); if (addEUToGlobalEnergyMap(ownerUUID, energyNeeded.negate())) { // Process recipe return CheckRecipeResultRegistry.SUCCESSFUL; } return CheckRecipeResultRegistry.insufficientPower(requiredEU); } // Normal energy hatch processing return super.checkProcessing(); } // Placeholder for addEUToGlobalEnergyMap and CheckRecipeResult related methods private boolean addEUToGlobalEnergyMap(UUID uuid, BigInteger energy) { return true; } private static class CheckRecipeResultRegistry { public static CheckRecipeResult SUCCESSFUL; public static CheckRecipeResult insufficientPower(int eu) { return null; } } private static class CheckRecipeResult {} private static class MultiMachineBase { protected int requiredEU; public CheckRecipeResult checkProcessing() { return null; } } } ``` ### Response This interface manages internal states and interactions with a global energy network. Success is determined by the `checkProcessing()` method returning `CheckRecipeResultRegistry.SUCCESSFUL` when sufficient wireless energy is available. ``` -------------------------------- ### Configure GTNL Features with MainConfig (Java) Source: https://context7.com/abkqpo/gt-not-leisure/llms.txt The MainConfig class in GTNL allows for extensive configuration of various features, including machine settings, meteor miner behavior, artificial star parameters, tickrates, and recipe management. These settings are typically defined in a configuration file and can be reloaded programmatically. ```java // Configuration file location: config/GTNotLeisure/main.cfg // Machine settings MainConfig.enableRecipeOutputChance = true; // Enable output chance multiplier MainConfig.recipeOutputChance = 2.5; // Output multiplier (like QFT) MainConfig.enableMachineAmpLimit = true; // Restrict laser hatch usage // Meteor Miner settings MainConfig.meteorMinerMaxBlockPerCycle = 1; // Blocks per processing cycle MainConfig.meteorMinerMaxRowPerCycle = 1; // Rows per processing cycle // Artificial Star settings MainConfig.euEveryEnhancementCore = 100; // EU per enhancement core MainConfig.euEveryDepletedExcitedNaquadahFuelRod = 4125000; MainConfig.secondsOfArtificialStarProgressCycleTime = 6.4; // Tickrate settings MainConfig.defaultTickrate = 20.0f; // Default game tick rate MainConfig.minTickrate = 0.1f; // Minimum allowed tickrate MainConfig.maxTickrate = 1000f; // Maximum allowed tickrate // Recipe settings MainConfig.enableDeleteRecipe = true; // Enable recipe removal/replacement MainConfig.enableChamberRecipesBuff = true; // Buff chamber recipes // Reload configuration programmatically MainConfig.reloadConfig(); ``` -------------------------------- ### MeteorMiner Configuration - Java Source: https://context7.com/abkqpo/gt-not-leisure/llms.txt Shows configuration variables for the MeteorMiner, controlling the maximum blocks and rows processed per cycle. This machine automates meteor harvesting with optional Fortune processing and has different tiers for basic harvesting and enhanced ore yields. ```java // Machine specifications: // - Scan area: 100x150x100 blocks (configurable) // - Tier 1: Basic meteor harvesting // - Tier 2: Fortune V support for increased ore yields // Configuration options in MainConfig: public static int meteorMinerMaxBlockPerCycle = 1; // Blocks processed per cycle public static int meteorMinerMaxRowPerCycle = 1; // Rows processed per cycle // The machine uses laser beacons for visual feedback // Structure definition loaded from: multiblock/meteor_miner_one (Tier 1) // multiblock/meteor_miner_two (Tier 2) // Usage: Place the controller and build the structure // The machine will automatically scan for meteors and process ores // Fortune tier is determined by installed components ``` -------------------------------- ### TickrateAPI for Server/Client Tickrate Control (Java) Source: https://context7.com/abkqpo/gt-not-leisure/llms.txt Provides static methods to dynamically alter the game's tick rate on both the server and client sides. This API is useful for implementing time manipulation mechanics. It includes functions to change tickrates globally, per-player, and to retrieve the current server tickrate. Input is a float representing ticks per second. ```Java package com.science.gtnl.api; import net.minecraft.entity.player.EntityPlayer; public class TickrateAPI { /** * Change both server and client tickrate simultaneously * @param ticksPerSecond Target ticks per second (default is 20.0) */ public static void changeTickrate(float ticksPerSecond); /** * Change only the server tickrate */ public static void changeServerTickrate(float ticksPerSecond); /** * Change tickrate for all connected clients */ public static void changeClientTickrate(float ticksPerSecond); /** * Change tickrate for a specific player's client */ public static void changeClientTickrate(EntityPlayer player, float ticksPerSecond); /** * Get current server tickrate * @return Ticks per second */ public static float getServerTickrate(); /** * Validate tickrate value */ public static boolean isValidTickrate(float ticksPerSecond); } ``` ```Java // Example: Slow motion effect public void applySlowMotion(EntityPlayer player, int durationTicks) { // Save original tickrate float originalTickrate = TickrateAPI.getServerTickrate(); // Apply slow motion (5 TPS = 4x slower) TickrateAPI.changeTickrate(5.0f); // Schedule restoration after duration ScheduledTask.schedule(() -> { TickrateAPI.changeTickrate(originalTickrate); }, durationTicks); } ``` ```Java // Example: Time acceleration for specific player public void acceleratePlayerTime(EntityPlayer player) { // Double speed for this player only TickrateAPI.changeClientTickrate(player, 40.0f); } ``` -------------------------------- ### GTNL Configuration Reload Command - Bash Source: https://context7.com/abkqpo/gt-not-leisure/llms.txt Demonstrates the usage of the /gtnl_reloadconfig command to reload the GTNL mod's configuration without requiring a server restart. This command syncs the configuration to all connected players and displays status messages. ```bash # Reload all GTNL configuration /gtnl_reloadconfig # This command: # 1. Reloads config/GTNotLeisure/main.cfg # 2. Syncs configuration to all connected players # 3. Displays status messages about enabled features # Permission level: 3 (operator) ``` -------------------------------- ### TickrateAPI - Server/Client Tickrate Control Source: https://context7.com/abkqpo/gt-not-leisure/llms.txt Provides methods to dynamically change the game's tick rate for both server and client, useful for time manipulation mechanics. ```APIDOC ## Class TickrateAPI ### Description Provides methods to dynamically change the game's tick rate for both server and client, useful for time manipulation mechanics. ### Methods - **changeTickrate(float ticksPerSecond)**: Changes both server and client tickrate simultaneously. `ticksPerSecond` is the target ticks per second (default is 20.0). - **changeServerTickrate(float ticksPerSecond)**: Changes only the server tickrate. - **changeClientTickrate(float ticksPerSecond)**: Changes tickrate for all connected clients. - **changeClientTickrate(EntityPlayer player, float ticksPerSecond)**: Changes tickrate for a specific player's client. - **getServerTickrate()**: Returns the current server tickrate (ticks per second). - **isValidTickrate(float ticksPerSecond)**: Validates if a tickrate value is acceptable. ### Example Usage **Apply Slow Motion:** ```java public void applySlowMotion(EntityPlayer player, int durationTicks) { float originalTickrate = TickrateAPI.getServerTickrate(); TickrateAPI.changeTickrate(5.0f); // 5 TPS = 4x slower ScheduledTask.schedule(() -> { TickrateAPI.changeTickrate(originalTickrate); }, durationTicks); } ``` **Accelerate Player Time:** ```java public void acceleratePlayerTime(EntityPlayer player) { TickrateAPI.changeClientTickrate(player, 40.0f); // Double speed for this player only } ``` ``` -------------------------------- ### WhiteNightGenerator Power Generation Logic - Java Source: https://context7.com/abkqpo/gt-not-leisure/llms.txt Implements the power generation logic for the WhiteNightGenerator, calculating energy output based on current output and a multiplier, with support for wireless mode to inject energy directly into the global network. It also handles standard energy output via hatches. ```java // Power generation formula: // Output = currentOutputEU * Integer.MAX_VALUE EU per 300 seconds // Supports wireless mode for direct global energy network injection @Override public CheckRecipeResult checkProcessing() { mMaxProgresstime = 6000; // 300 seconds at 20 TPS if (wirelessMode) { BigInteger eu = BigInteger.valueOf(this.currentOutputEU) .multiply(BigInteger.valueOf(Integer.MAX_VALUE)); if (addEUToGlobalEnergyMap(ownerUUID, eu)) { return CheckRecipeResultRegistry.GENERATING; } return CheckRecipeResultRegistry.INTERNAL_ERROR; } else { addEnergyOutput(this.currentOutputEU * Integer.MAX_VALUE); return CheckRecipeResultRegistry.GENERATING; } } // WAILA integration shows current output // Structure: Complex multi-layer design loaded from multiblock/white_night_generator ``` -------------------------------- ### Utilize GTNL Custom Recipe Maps (Java) Source: https://context7.com/abkqpo/gt-not-leisure/llms.txt GTNL defines specific recipe maps for its multiblock machines to manage their unique crafting recipes. This snippet lists available recipe maps within GTNLRecipeMaps and demonstrates utility functions for recipe manipulation, such as copying, removing, and generating recipes. ```java // Available recipe maps in GTNLRecipeMaps: GTNLRecipeMaps.GrandAssemblyLineSpecialRecipes // Grand Assembly Line GTNLRecipeMaps.RealArtificialStarRecipes // Artificial Star Generator GTNLRecipeMaps.PetrochemicalPlantRecipes // Petrochemical Plant GTNLRecipeMaps.BloodDemonInjectionRecipes // Blood Soul Sacrificial Array GTNLRecipeMaps.SteamFusionReactorRecipes // Steam Fusion Reactor GTNLRecipeMaps.LargeBioLabRecipes // Large Bio Lab GTNLRecipeMaps.ConvertToCircuitAssemblerRecipes // Circuit conversion recipes // Recipe utility functions RecipeUtil.copyAllRecipes(sourceMap, targetMap); RecipeUtil.removeMatchingRecipes(sourceMap, targetMap); RecipeUtil.generateRecipesBioLab(input, output, flag, multiplier); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.