Interface SurfaceRule
- All Superinterfaces:
Wrapper
- All Known Subinterfaces:
AbovePreliminarySurfaceConditionSource, BandlandsRuleSource, BiomeConditionSource, BlockRuleSource, ConditionRuleSource, ConditionSource, HoleConditionSource, NoiseThresholdConditionSource, NotConditionSource, PaperOptionallyFlatBedrockConditionSource, RuleSource, SequenceRuleSource, SteepConditionSource, StoneDepthConditionSource, TemperatureConditionSource, VerticalGradientConditionSource, WaterConditionSource, YAboveConditionSource
The shared supertype of the surface-rule family (
SurfaceRules), merging the
rule sources that decide which block is placed at the surface and the
condition sources that gate them.- Since:
- 2.4.0
- See Also:
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionMatches above the preliminary surface level.static BandlandsRuleSourceThe badlands banded-terracotta rule.static BlockRuleSourcePlaces the given block's default state.static HoleConditionSourcehole()Matches in surface holes.static ConditionRuleSourceifTrue(ConditionSource condition, RuleSource then) Applies a rule only when a condition holds.static BiomeConditionSource.BuilderisBiome()Creates a new biome condition source builder.static BiomeConditionSourceMatches when the current biome is one of the given biomes.static BiomeConditionSourceMatches when the current biome is one of the given biomes.Creates a new noise threshold condition source builder.noiseThreshold(ResourceKey noise, double minThreshold) Matches when a registered noise sampled at this position is at or above the threshold.noiseThreshold(ResourceKey noise, double minThreshold, double maxThreshold) Matches when a registered noise sampled at this position is within the threshold range.static NotConditionSourcenot(ConditionSource target) Inverts another condition.Creates a new optionally-flat bedrock condition source builder.optionallyFlatBedrock(ResourceKey randomName, VerticalAnchor trueAtAndBelow, VerticalAnchor falseAtAndAbove, boolean roof) Creates Paper's bedrock gradient, which collapses to one layer when flat bedrock is enabled.static SequenceRuleSource.Buildersequence()Creates a new sequence rule source builder.static SequenceRuleSourcesequence(RuleSource... rules) Evaluates rules in order, using the first that applies.static SequenceRuleSourcesequence(List<RuleSource> rules) Evaluates rules in order, using the first that applies.static SteepConditionSourcesteep()Matches on steep terrain.Creates a new stone-depth condition source builder.static StoneDepthConditionSourcestoneDepth(int offset, boolean addSurfaceDepth, int secondaryDepthRange, CaveSurface surfaceType) Matches within a given depth of stone from the floor or ceiling, with a secondary depth range.static StoneDepthConditionSourcestoneDepth(int offset, boolean addSurfaceDepth, CaveSurface surfaceType) Matches within a given depth of stone from the floor or ceiling.static TemperatureConditionSourceMatches where the biome is cold enough to snow.Creates a new vertical-gradient condition source builder.verticalGradient(String randomName, VerticalAnchor trueAtAndBelow, VerticalAnchor falseAtAndAbove) A noisy vertical gradient that is true below one anchor and false above another, fading between.static WaterConditionSource.Builderwater()Creates a new water condition source builder.static WaterConditionSourcewaterBlockCheck(int offset, int surfaceDepthMultiplier) Matches relative to the water level at the current block.static WaterConditionSourcewaterStartCheck(int offset, int surfaceDepthMultiplier) Matches relative to the water level at the column start.yAbove()Creates a new y-above condition source builder.static YAboveConditionSourceyBlockCheck(VerticalAnchor anchor, int surfaceDepthMultiplier) Matches at or above a vertical anchor, evaluated per block.static YAboveConditionSourceyStartCheck(VerticalAnchor anchor, int surfaceDepthMultiplier) Matches at or above a vertical anchor, evaluated at the column start.Methods inherited from interface Wrapper
asHandle, toMinecraft, unwrap
-
Method Details
-
stoneDepth
@AsOf("3.0.0") static StoneDepthConditionSource stoneDepth(int offset, boolean addSurfaceDepth, CaveSurface surfaceType) Matches within a given depth of stone from the floor or ceiling.- Parameters:
offset- the vertical offsetaddSurfaceDepth- whether the biome surface depth is added to the offsetsurfaceType- the face to measure from- Returns:
- a stone-depth condition
- Since:
- 3.0.0
-
stoneDepth
@AsOf("3.0.0") static StoneDepthConditionSource stoneDepth(int offset, boolean addSurfaceDepth, int secondaryDepthRange, CaveSurface surfaceType) Matches within a given depth of stone from the floor or ceiling, with a secondary depth range.- Parameters:
offset- the vertical offsetaddSurfaceDepth- whether the biome surface depth is added to the offsetsecondaryDepthRange- the secondary depth rangesurfaceType- the face to measure from- Returns:
- a stone-depth condition
- Since:
- 3.0.0
-
stoneDepth
Creates a new stone-depth condition source builder.- Returns:
- a new stone-depth condition source builder
- Since:
- 3.0.0
-
not
Inverts another condition.- Parameters:
target- the condition to invert- Returns:
- a negated condition
- Since:
- 3.0.0
-
waterBlockCheck
Matches relative to the water level at the current block.- Parameters:
offset- the offset from the water levelsurfaceDepthMultiplier- the surface depth multiplier- Returns:
- a water condition
- Since:
- 3.0.0
-
waterStartCheck
Matches relative to the water level at the column start.- Parameters:
offset- the offset from the water levelsurfaceDepthMultiplier- the surface depth multiplier- Returns:
- a water condition
- Since:
- 3.0.0
-
water
Creates a new water condition source builder.- Returns:
- a new water condition source builder
- Since:
- 3.0.0
-
isBiome
Matches when the current biome is one of the given biomes.- Parameters:
biomes- the biomes to match- Returns:
- a biome condition
- Since:
- 3.0.0
-
isBiome
Matches when the current biome is one of the given biomes.- Parameters:
biomes- the biomes to match- Returns:
- a biome condition
- Since:
- 3.0.0
-
isBiome
Creates a new biome condition source builder.- Returns:
- a new biome condition source builder
- Since:
- 3.0.0
-
noiseThreshold
@AsOf("3.0.0") static NoiseThresholdConditionSource noiseThreshold(ResourceKey noise, double minThreshold) Matches when a registered noise sampled at this position is at or above the threshold.- Parameters:
noise- the noise parameters keyminThreshold- the lower threshold- Returns:
- a noise condition
- Since:
- 3.0.0
-
noiseThreshold
@AsOf("3.0.0") static NoiseThresholdConditionSource noiseThreshold(ResourceKey noise, double minThreshold, double maxThreshold) Matches when a registered noise sampled at this position is within the threshold range.- Parameters:
noise- the noise parameters keyminThreshold- the lower thresholdmaxThreshold- the upper threshold- Returns:
- a noise condition
- Since:
- 3.0.0
-
noiseThreshold
Creates a new noise threshold condition source builder.- Returns:
- a new noise threshold condition source builder
- Since:
- 3.0.0
-
yBlockCheck
@AsOf("3.0.0") static YAboveConditionSource yBlockCheck(VerticalAnchor anchor, int surfaceDepthMultiplier) Matches at or above a vertical anchor, evaluated per block.- Parameters:
anchor- the vertical anchorsurfaceDepthMultiplier- the surface depth multiplier- Returns:
- a y-above condition
- Since:
- 3.0.0
-
yStartCheck
@AsOf("3.0.0") static YAboveConditionSource yStartCheck(VerticalAnchor anchor, int surfaceDepthMultiplier) Matches at or above a vertical anchor, evaluated at the column start.- Parameters:
anchor- the vertical anchorsurfaceDepthMultiplier- the surface depth multiplier- Returns:
- a y-above condition
- Since:
- 3.0.0
-
yAbove
Creates a new y-above condition source builder.- Returns:
- a new y-above condition source builder
- Since:
- 3.0.0
-
verticalGradient
@AsOf("3.0.0") static VerticalGradientConditionSource verticalGradient(String randomName, VerticalAnchor trueAtAndBelow, VerticalAnchor falseAtAndAbove) A noisy vertical gradient that is true below one anchor and false above another, fading between.- Parameters:
randomName- the seed name for the gradient noisetrueAtAndBelow- the anchor at and below which the condition is truefalseAtAndAbove- the anchor at and above which the condition is false- Returns:
- a vertical-gradient condition
- Since:
- 3.0.0
-
verticalGradient
Creates a new vertical-gradient condition source builder.- Returns:
- a new vertical-gradient condition source builder
- Since:
- 3.0.0
-
optionallyFlatBedrock
@AsOf("3.3.0") static PaperOptionallyFlatBedrockConditionSource optionallyFlatBedrock(ResourceKey randomName, VerticalAnchor trueAtAndBelow, VerticalAnchor falseAtAndAbove, boolean roof) Creates Paper's bedrock gradient, which collapses to one layer when flat bedrock is enabled.- Parameters:
randomName- the seed name for the gradient noisetrueAtAndBelow- the anchor at and below which the condition is truefalseAtAndAbove- the anchor at and above which the condition is falseroof- whether the collapsed flat layer belongs to the dimension roof- Returns:
- an optionally-flat bedrock condition
- Since:
- 3.3.0
-
optionallyFlatBedrock
Creates a new optionally-flat bedrock condition source builder.- Returns:
- a new optionally-flat bedrock condition source builder
- Since:
- 3.3.0
-
steep
Matches on steep terrain.- Returns:
- a steep condition
- Since:
- 3.0.0
-
hole
Matches in surface holes.- Returns:
- a hole condition
- Since:
- 3.0.0
-
abovePreliminarySurface
Matches above the preliminary surface level.- Returns:
- an above-preliminary-surface condition
- Since:
- 3.0.0
-
temperature
Matches where the biome is cold enough to snow.- Returns:
- a temperature condition
- Since:
- 3.0.0
-
bandlands
The badlands banded-terracotta rule.- Returns:
- the bandlands rule
- Since:
- 3.0.0
-
block
Places the given block's default state.- Parameters:
block- the block to place- Returns:
- a block rule
- Since:
- 3.0.0
-
sequence
Evaluates rules in order, using the first that applies.- Parameters:
rules- the rules to evaluate in order- Returns:
- a sequence rule
- Since:
- 3.0.0
-
sequence
Evaluates rules in order, using the first that applies.- Parameters:
rules- the rules to evaluate in order- Returns:
- a sequence rule
- Since:
- 3.0.0
-
sequence
Creates a new sequence rule source builder.- Returns:
- a new sequence rule source builder
- Since:
- 3.0.0
-
ifTrue
Applies a rule only when a condition holds.- Parameters:
condition- the gating conditionthen- the rule to apply when the condition holds- Returns:
- a conditional rule
- Since:
- 3.0.0
-