Interface RuleOutput
- 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
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<RuleOutput> Dispatch codec for serializing and deserializing anyRuleOutputimplementation based on its"type"field. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.level.block.state.BlockStategetOutput(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 outputBlockStatefor a matched block position.Retrieves the unique string identifier for this output type.
-
Field Details
-
CODEC
Dispatch codec for serializing and deserializing anyRuleOutputimplementation 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 outputBlockStatefor 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.
-