All Known Implementing Classes:
ConstantOutput, GradientOutput, WeightedOutput

public interface RuleOutput
A contract interface defining the block state outcome of an OverhauledRule.

Allows structure processor rules to output constant blocks (ConstantOutput), weighted random blocks (WeightedOutput), or spatial gradients (GradientOutput).

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<RuleOutput>
    Dispatch codec for serializing and deserializing any RuleOutput implementation based on its "type" field.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.level.block.state.BlockState
    getOutput(net.minecraft.util.RandomSource random, net.minecraft.core.BlockPos localPos, net.minecraft.core.BlockPos absolutePos, net.minecraft.world.level.levelgen.structure.templatesystem.StructurePlaceSettings settings)
    Resolves the output BlockState for a matched block position.
    Retrieves the unique string identifier for this output type.
  • Field Details

    • CODEC

      static final com.mojang.serialization.Codec<RuleOutput> CODEC
      Dispatch codec for serializing and deserializing any RuleOutput implementation based on its "type" field.
  • Method Details

    • getTypeId

      String getTypeId()
      Retrieves the unique string identifier for this output type.
      Returns:
      The type identifier (e.g., "constant", "weighted", or "gradient").
    • getOutput

      net.minecraft.world.level.block.state.BlockState getOutput(net.minecraft.util.RandomSource random, net.minecraft.core.BlockPos localPos, net.minecraft.core.BlockPos absolutePos, net.minecraft.world.level.levelgen.structure.templatesystem.StructurePlaceSettings settings)
      Resolves the output BlockState for a matched block position.
      Parameters:
      random - The per-block deterministic random source.
      localPos - The unrotated template-local block position.
      absolutePos - The transformed world-space block position.
      settings - The structure placement settings.
      Returns:
      The resolved BlockState.