8. Custom Machines: Machine Format Position Permutations [Advanced] - HellFirePvP/ModularMachinery GitHub Wiki

As described and shown at the end of the Machine Format wiki page, the block-pattern definition for the machine can be very clunky. To help combat that, you can define arrays of positions and the mod will build all permutations over those.

Example from the Machine format page: One part of the block-pattern, the lowest layer, had the following positions:

[1, -1, 2], [0, -1, 2], [-1, -1, 2], [1, -1, 1], [0, -1, 1], [-1, -1, 1], [1, -1, 0], [0, -1, 0], [-1, -1, 0]

Now those describe essentially the 3x3 lower "floor" of the machine. y is always -1, x ranges from 1 to -1, z ranges from 2 to 0. Instead of writing entries for all those positions, you can also write:

    [...]
    {
        "x": [1, 0, -1],
        "y": -1,
        "z": [2, 1, 0],
        "elements": [
            "modularmachinery:blockcasing",
            "modularmachinery:blockinputitem",
            "modularmachinery:blockinputenergy",
            "modularmachinery:blockoutputitem",
            "modularmachinery:blockoutputfluid"
        ]
    }
    [...]

The mod will build all possible combinations of all coordinates given. So instead of writing 9 entries, you can also just write 1 in this example.

Let's have another example:

[1, 0, 2], [-1, 0, 2], [1, 0, 0], [-1, 0, 0], [1, 1, 2], [-1, 1, 2], [1, 1, 0], [-1, 1, 0]

Now this follows a similiar pattern: x is either 1 or -1, z is either 0 or 2, and y is either 0 or 1. All possible combinations/permutations of those are listed above, so you can just write them as follows:

    [...]
    {
        "x": [1, -1],
        "y": [0, 1],
        "z": [0, 2],
        "elements": [
            ...
        ]
    }
    [...]