EnderIO 1.5-1.12 Documentation

repository·master·Indexed 20 days ago

https://github.com/sleepytrousers/enderio-1.5-1.12

Source 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.

Tokens
2.1K
Snippets
5
Records
10
Agent score
73%

What's inside EnderIO 1.5-1.12

  1. How to modify EnderIO loot tables for development

    master

    If you are developing for EnderIO, do not manually edit the JSON files in the loot_tables/chests/ directory. These files are re-generated by LootTweaker.

    To ensure changes are persistent, you should:

    1. Edit LootManager.java to have the JSONs re-created by LootTweaker.
    2. If you must edit the JSONs directly, ensure you also apply the same edits in LootManager.java so they are not overwritten during the next regeneration cycle.
  2. Identify Conduit Texture Variants

    master

    The 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
  3. Use ICapacitorKey methods to retrieve scaled values

    master

    When interacting with a capacitor, use the following methods on an ICapacitorKey instance to retrieve values:

    MethodDescription
    get(float level)Returns the scaled value as an int for the specified level.
    getFloat(float level)Returns the scaled value as a float for the specified level.
    get(ICapacitorData data)Returns the scaled value as an int using the level provided by the ICapacitorData.
    getFloat(ICapacitorData data)Returns the scaled value as a float using the level provided by the ICapacitorData.
    getDefault()Returns the int value for level 1.
    getDefaultFloat()Returns the float value for level 1.
    getBaseValue()Returns the unscaled int base value.
  4. Implement ICapacitorKey for capacitor value calculation

    master

    The ICapacitorKey interface 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) and setBaseValue(int baseValue) to configure the key.

    // Implementation logic overview
    // final value = getBaseValue() * scaler(level)
  5. Implement IDustTrigger for custom dust crafting effects

    master

    Implement the IDustTrigger interface 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:

    1. getValidFace(...): Determines if the dust application is valid at a specific position and face. It returns a Placement object containing the offset and facing, or null if invalid.
    2. execute(...): Performs the actual logic of the dust operation (e.g., changing a block state or consuming items).
    3. sparkle(...) (Optional): Returns a list of BlockPos where 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());
  6. Use the /enderio config command to manage settings

    master

    The /enderio config command 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
  7. Use the Placement class for dust application offsets

    master

    The Placement inner class is used by getValidFace to 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: The EnumFacing direction of the placement.
    // Example instantiation
    Placement placement = new Placement(0, 1, 0, EnumFacing.UP);