Class MultiblockDefinitions

java.lang.Object
fr.robie.machineengine.api.multiblock.MultiblockDefinitions

public final class MultiblockDefinitions extends Object
Multiblocks in data-driven definitions (D33): the multiblocks: section of a definitions file, and the behavior type machineengine:multiblock_member.
multiblocks:
  mypack:altar:                       # a fixed shape, matched in 4 rotations
    pattern:
      layers:                         # bottom up; rows north to south; characters west to east
        - ["CCC", "C#C", "CCC"]
        - ["   ", " G ", "   "]
      key: {C: mypack:altar_casing, "#": mypack:altar_core, G: [minecraft:glass, minecraft:tinted_glass]}
      anchor: "#"                     # holds the storages; must be a member machine
      rotate: true                    # optional, default true
    capacities: {mana: 64000}         # optional: the anchor's storages while formed
  mypack:vat:                         # a hollow box
    box:
      casing: mypack:vat_casing       # edges and corners
      faces: [mypack:vat_casing, mypack:vat_valve, minecraft:glass]
      interior: [minecraft:air]       # optional, default any block
      min-size: 3                     # optional (3..), max-size 18, width 0 (any), open-top false
      controller: mypack:vat_valve    # optional: exactly one in the walls
    capacities: {fluid: {per-block: 16000}}   # a number, or per interior block

machines:
  mypack:altar_core:
    behavior:
      type: machineengine:multiblock_member
      multiblocks: [mypack:altar]
      role: frame                     # frame (default), valve or port
      storages: [mana]                # valve and port: the anchor's storages it passes through
      exclusive: false                # valve: holds one of its storages at a time
      output-rate: 1000               # port: per tick pushed out in output mode
  • Method Details

    • type

      @NotNull public static @NotNull Result<MultiblockType> type(@NotNull @NotNull net.kyori.adventure.key.Key key, @NotNull @NotNull DataMap spec)
      One entry of the multiblocks: section.
    • member

      @NotNull public static @NotNull Result<MachineBehavior.Factory> member(@NotNull @NotNull DataMap config, @NotNull @NotNull DefinitionContext context)
      The behavior type machineengine:multiblock_member's parser.