EnderIO 1.5-1.12 Documentation
repository·master·Indexed 20 days ago
https://github.com/sleepytrousers/enderio-1.5-1.12Source code and developer documentation for the 1.5 branch of EnderIO, a Minecraft 1.12 mod. Includes API details for implementing IDustTrigger for Thaumcraft interactions, using ICapacitorKey for value scaling, managing settings via the /enderio config command, and guidelines for modifying loot tables and conduit textures.
What's inside EnderIO 1.5-1.12
- EnderIO loot tables are designed to be additive. They are integrated into vanilla Minecraft loot tables using the same names. Modpack makers can use these tables directly or utilize the included loot functions in other custom loot table definitions.
How to modify EnderIO loot tables for development
masterIf you are developing for EnderIO, do not manually edit the JSON files in the
loot_tables/chests/directory. These files are re-generated byLootTweaker.To ensure changes are persistent, you should:
- Edit
LootManager.javato have the JSONs re-created byLootTweaker. - If you must edit the JSONs directly, ensure you also apply the same edits in
LootManager.javaso they are not overwritten during the next regeneration cycle.
- Edit
Identify Conduit Texture Variants
masterThe EnderIO conduit textures use specific row layouts in their sprite sheets to represent different states and types. Use this guide to identify the visual state of a conduit in-game:
Redstone Conduits (
redstone_conduit.png)- Row 1: Item conduit
- Row 2: Redstone conduit (outer)
- Row 3: Redstone conduit (inner), active
- Row 4: Redstone conduit (inner), inactive
Liquid Conduits (
liquid_conduit.png)- Row 1: Liquid conduit
- Row 2: Advanced liquid conduit
- Row 3: Advanced liquid conduit, locked to one fluid type
- Row 4: Ender fluid conduit
Energy Conduits (
power_conduit.png)- Row 1: Tier 1 energy conduit
- Row 2: Tier 2 energy conduit
- Row 3: Tier 3 energy conduit
- Row 4: Unused
Use ICapacitorKey methods to retrieve scaled values
masterWhen interacting with a capacitor, use the following methods on an
ICapacitorKeyinstance to retrieve values:Method Description get(float level)Returns the scaled value as an intfor the specified level.getFloat(float level)Returns the scaled value as a floatfor the specified level.get(ICapacitorData data)Returns the scaled value as an intusing the level provided by theICapacitorData.getFloat(ICapacitorData data)Returns the scaled value as a floatusing the level provided by theICapacitorData.getDefault()Returns the intvalue for level 1.getDefaultFloat()Returns the floatvalue for level 1.getBaseValue()Returns the unscaled intbase value.Implement ICapacitorKey for capacitor value calculation
masterThe
ICapacitorKeyinterface is used to define how values (such as energy or other capacities) scale based on a capacitor's level. The final value is calculated as:final value = base value * scaler(capacitor level).Key behaviors:
- Capacitor Levels: Standard capacitors use levels 1, 2, and 3. Custom capacitors can use any non-zero, positive level.
- Scaling: The
getFloat(float level)method must be implemented to define the scaling logic. - Default Values:
getDefaultFloat()returns the value for level 1. - Base Value:
getBaseValue()returns the unscaled base value.
Note: If you are using the XML configuration system, you may use
setScaler(Scaler scaler)andsetBaseValue(int baseValue)to configure the key.// Implementation logic overview // final value = getBaseValue() * scaler(level)Register a custom IDustTrigger
masterTo make your custom
IDustTriggerimplementation active in the game, call the static methodregisterDustTriggerand pass in your implementation instance. This adds your trigger to the internal registry used by Thaumcraft.IDustTrigger.registerDustTrigger(myTriggerInstance);Implement IDustTrigger for custom dust crafting effects
masterImplement the
IDustTriggerinterface to add custom dust-based crafting interactions to Thaumcraft. This interface allows you to define where dust can be applied to blocks, what happens when it is applied, and where visual sparkle effects should appear.To use this, you must implement three primary methods:
getValidFace(...): Determines if the dust application is valid at a specific position and face. It returns aPlacementobject containing the offset and facing, ornullif invalid.execute(...): Performs the actual logic of the dust operation (e.g., changing a block state or consuming items).sparkle(...)(Optional): Returns a list ofBlockPoswhere dust sparkle particle effects should be rendered. The default implementation only sparkles at the clicked position.
After implementation, register your trigger using
IDustTrigger.registerDustTrigger(yourTriggerInstance).public class MyCustomDustTrigger implements IDustTrigger { @Override public Placement getValidFace(World world, EntityPlayer player, BlockPos pos, EnumFacing face) { // Return a new Placement(x, y, z, facing) if valid, else null return new Placement(0, 1, 0, face); } @Override public void execute(World world, EntityPlayer player, BlockPos pos, Placement placement, EnumFacing side) { // Perform the crafting logic here } @Override public List<BlockPos> sparkle(World world, EntityPlayer player, BlockPos pos, Placement placement) { // Return list of positions for particle effects return Arrays.asList(pos); } } // Registration IDustTrigger.registerDustTrigger(new MyCustomDustTrigger());Use the /enderio config command to manage settings
masterThe
/enderio configcommand allows server administrators to view, modify, and save EnderIO configuration settings directly from the Minecraft in-game console or chat.Command Syntax
- Set a value:
/enderio config set <section> <key> <value>- Updates a specific configuration property. If the property has a restricted list of valid values, the command will validate your input against them.
- Get a value:
/enderio config get <section> <key>- Retrieves the current value of a configuration property and displays its description/comment.
- List sections or keys:
/enderio config list [<section>]- If no argument is provided, lists all available configuration sections.
- If a partial or full section name is provided, lists matching sections. If the section name is an exact match, it lists the keys within that section.
- Save changes:
/enderio config save- Persists the current in-memory configuration changes to the disk.
- View help:
/enderio config help [<page_number>]- Displays paginated help documentation for the configuration command.
Section Naming Convention
Sections are identified using a dot-notation format:
<configuration_name>.<category_name>(e.g.,enderio.general)./enderio config set <section> <key> <value> /enderio config get <section> <key> /enderio config list [<section>] /enderio config save /enderio config help- Set a value:
Use the Placement class for dust application offsets
masterThe
Placementinner class is used bygetValidFaceto communicate the target offset and direction for a dust operation. It contains the following fields:xOffset: Integer offset on the X axis.yOffset: Integer offset on the Y axis.zOffset: Integer offset on the Z axis.facing: TheEnumFacingdirection of the placement.
// Example instantiation Placement placement = new Placement(0, 1, 0, EnumFacing.UP);Handle UnconfiguredCapKeyException
masterTheUnconfiguredCapKeyExceptionis thrown during thevalidate()call if a capacitor key has not been properly configured via the XML system. This is aRuntimeExceptionused to ensure that all keys required by the system have valid scalers and base values assigned.