I/O Config

Add a default I/O side config for any component

Some components have a config property that you can define in the machine json.

This property can be used to define the default Input/Output (I/O) sides for the component.

Supported components :

This property will define the default I/O mode of the component for each side of the machine, but these I/O modes can be changed later in game by the player if you add a config element to the machine GUI.

Side modes

You can configure the I/O mode of a specific component for each sides of the machine.

Available sides are : top, bottom, front, back, right, left

The machine front side is the side that faced the player when the machine was placed.

You can also use default to configure each sides that aren't specified.

Available I/O modes :

  • input : only input

  • output : only output

  • both : input and output

  • none : neither input nor output

Auto input/output

Starting from CM 0.7.0 the machines now have the ability to auto input/output items, fluids and energy from/to blocks next to the machine.

By default this behavior is disabled for items and fluids.

For energy components the default behavior is to auto input from all sides.

To enable or disable auto I/O simply use :

"config": {
    "input": true, //Enable auto-input
    "output": false, //Disable auto-output
}

Disabling gui config

By default any player can change the side mode of a component, or activate auto I/O by using the config button (only if a config gui element is present in the machine GUI).

You can prevent player to config a specific component by adding in the config :

"enabled": false

Example :

A component config that has the following properties :

  • Allow input from the left side.

  • Allow output to the right side.

  • All other sides (top, bottom, front and back) can't input or output.

  • Auto input and output are enabled.

  • The config can't be modified by the player with the gui config button.

{
    "type": "item",
    "mode": "input",
    "id": "slot1",
    "config": {
        "default": "none",
        "right": "output",
        "left": "input",
        "input": true,
        "output": true,
        "enabled": false
    }
}

All sides are optional.

default will act for all sides that are not specified.

If default is not specified both mode will be used.

Last updated