Skip to content

Processor Types

Apollo edited this page Nov 23, 2024 · 3 revisions

Condition-related

Non condition-related


condition

Versatile processor that can replicate the functionality of most other processors using the processor condition system.

{
  "processor_type": "lithostitched:condition",
  "random_mode": {
    "mode": "per_block",
    "name": "example:blackstone"
  },
  "if_true": [
    {
      "type": "lithostitched:matching_blocks",
      "blocks": "minecraft:stone",
      "match_type": "input"
    },
    {
      "type": "lithostitched:random_chance",
      "chance": 0.5
    }
  ],
  "then": {
    "processor_type": "lithostitched:set_block",
    "state_provider": {
      "type": "minecraft:simple_state_provider",
      "state": {
        "Name": "minecraft:blackstone"
      }
    }
  }
}
  • random_mode: Settings for the randomness. Defaults to a mode of per_block and an id of lithostitched:default.
    • mode: The random mode to use. Either per_block or per_piece.
    • name: A resource location to use for further randomness. Can be any id, but keep it unique from other processors in the file to prevent issues.
  • if_true: One or more processor conditions to check.
  • then: One or more processors to apply if the processor condition(s) pass. The set block and discard input processors were built specifically to be used here, but any processors work.

discard_input

Discards the block from the structure template and uses the block in the world. Built to be used in conjunction with the condition processor.

No further fields.


set_block

Sets the block to be placed from a block state provider. Built to be used in conjunction with the condition processor.

{
  "processor_type": "lithostitched:set_block",
  "state_provider": {
    "type": "minecraft:weighted_state_provider",
    "entries": [
      {
        "weight": 3,
        "data": {
          "Name": "minecraft:cobblestone_slab"
        }
      },
      {
        "weight": 1,
        "data": {
          "Name": "minecraft:mossy_cobblestone_slab"
        }
      }
    ]
  },
  "preserve_state": true,
  "random_mode": "per_block",
  "block_entity_modifier": {
    "type": "minecraft:passthrough"
  }
}
  • state_provider: The block state provider to choose the block to place from.
  • preserve_state: Whether to preserve the block state values from the previous input block. Defaults to true.
  • random_mode: The random mode to use for the block state provider, either per_block or per_piece. Defaults to per_block.
  • block_entity_modifier The block entity modifier to apply to the block. Defaults to passthrough.

apply_random

Applies one processor list at random from a list.

{
  "processor_type": "lithostitched:apply_random",
  "mode": "per_block",
  "processor_lists": [
    {
      "weight": 3,
      "data": "example:some_other_processor_a"
    },
    {
      "weight": 5,
      "data": "example:some_other_processor_b"
    }
  ]
}
  • mode: Determines the mode of the randomness. per_piece will choose a processor list to apply to each instance of a piece, while per_block will choose a processor list to apply to each block in each piece.
  • processor_lists: Either a weighted list of processor lists, a list of processor lists, or a processor list tag. Only one processor list from the list will be applied.

block_swap

Swaps blocks out for other blocks directly, copying over block states when possible.

{
  "processor_type": "lithostitched:block_swap",
  "blocks": {
    "minecraft:stone_bricks": "minecraft:deepslate_bricks",
    "minecraft:stone_brick_slab": "minecraft:deepslate_brick_slab",
    "minecraft:stone_brick_stairs": "minecraft:deepslate_brick_stairs",
    "minecraft:stone_brick_wall": "minecraft:deepslate_brick_wall"
  }
}
  • blocks: A map of block ids to block ids to determine which blocks get swapped with what other blocks. In the above example, all stone bricks (plus the slab/stair/wall variants) are replaced by their deepslate equivalents with their block states copied over.

reference

Applies processor list(s) from other files to the structure piece.

{
  "processor_type": "lithostitched:reference",
  "processor_lists": [
    "example:some_other_processor_a",
    "example:some_other_processor_b"
  ]
}
  • processor_lists: Either a single processor list, a list of processor lists, or a processor list tag (yes, you can make those) that dictates what processor lists are applied. These are run in order.