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

@NullMarked @AsOf("2.4.0") public interface SurfaceRule extends Wrapper
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 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 offset
      addSurfaceDepth - whether the biome surface depth is added to the offset
      surfaceType - 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 offset
      addSurfaceDepth - whether the biome surface depth is added to the offset
      secondaryDepthRange - the secondary depth range
      surfaceType - the face to measure from
      Returns:
      a stone-depth condition
      Since:
      3.0.0
    • stoneDepth

      @AsOf("3.0.0") static StoneDepthConditionSource.Builder stoneDepth()
      Creates a new stone-depth condition source builder.
      Returns:
      a new stone-depth condition source builder
      Since:
      3.0.0
    • not

      @AsOf("3.0.0") static NotConditionSource not(ConditionSource target)
      Inverts another condition.
      Parameters:
      target - the condition to invert
      Returns:
      a negated condition
      Since:
      3.0.0
    • waterBlockCheck

      @AsOf("3.0.0") static WaterConditionSource waterBlockCheck(int offset, int surfaceDepthMultiplier)
      Matches relative to the water level at the current block.
      Parameters:
      offset - the offset from the water level
      surfaceDepthMultiplier - the surface depth multiplier
      Returns:
      a water condition
      Since:
      3.0.0
    • waterStartCheck

      @AsOf("3.0.0") static WaterConditionSource waterStartCheck(int offset, int surfaceDepthMultiplier)
      Matches relative to the water level at the column start.
      Parameters:
      offset - the offset from the water level
      surfaceDepthMultiplier - the surface depth multiplier
      Returns:
      a water condition
      Since:
      3.0.0
    • water

      @AsOf("3.0.0") static WaterConditionSource.Builder water()
      Creates a new water condition source builder.
      Returns:
      a new water condition source builder
      Since:
      3.0.0
    • isBiome

      @AsOf("3.0.0") static BiomeConditionSource isBiome(List<Biome> biomes)
      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

      @AsOf("3.0.0") static BiomeConditionSource isBiome(Biome... biomes)
      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

      @AsOf("3.0.0") static BiomeConditionSource.Builder 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 key
      minThreshold - 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 key
      minThreshold - the lower threshold
      maxThreshold - the upper threshold
      Returns:
      a noise condition
      Since:
      3.0.0
    • noiseThreshold

      @AsOf("3.0.0") static NoiseThresholdConditionSource.Builder 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 anchor
      surfaceDepthMultiplier - 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 anchor
      surfaceDepthMultiplier - the surface depth multiplier
      Returns:
      a y-above condition
      Since:
      3.0.0
    • yAbove

      @AsOf("3.0.0") static YAboveConditionSource.Builder 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 noise
      trueAtAndBelow - the anchor at and below which the condition is true
      falseAtAndAbove - the anchor at and above which the condition is false
      Returns:
      a vertical-gradient condition
      Since:
      3.0.0
    • verticalGradient

      @AsOf("3.0.0") static VerticalGradientConditionSource.Builder 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 noise
      trueAtAndBelow - the anchor at and below which the condition is true
      falseAtAndAbove - the anchor at and above which the condition is false
      roof - whether the collapsed flat layer belongs to the dimension roof
      Returns:
      an optionally-flat bedrock condition
      Since:
      3.3.0
    • optionallyFlatBedrock

      @AsOf("3.3.0") static PaperOptionallyFlatBedrockConditionSource.Builder optionallyFlatBedrock()
      Creates a new optionally-flat bedrock condition source builder.
      Returns:
      a new optionally-flat bedrock condition source builder
      Since:
      3.3.0
    • steep

      @AsOf("3.0.0") static SteepConditionSource steep()
      Matches on steep terrain.
      Returns:
      a steep condition
      Since:
      3.0.0
    • hole

      @AsOf("3.0.0") static HoleConditionSource hole()
      Matches in surface holes.
      Returns:
      a hole condition
      Since:
      3.0.0
    • abovePreliminarySurface

      @AsOf("3.0.0") static AbovePreliminarySurfaceConditionSource abovePreliminarySurface()
      Matches above the preliminary surface level.
      Returns:
      an above-preliminary-surface condition
      Since:
      3.0.0
    • temperature

      @AsOf("3.0.0") static TemperatureConditionSource temperature()
      Matches where the biome is cold enough to snow.
      Returns:
      a temperature condition
      Since:
      3.0.0
    • bandlands

      @AsOf("3.0.0") static BandlandsRuleSource bandlands()
      The badlands banded-terracotta rule.
      Returns:
      the bandlands rule
      Since:
      3.0.0
    • block

      @AsOf("3.0.0") static BlockRuleSource block(Material block)
      Places the given block's default state.
      Parameters:
      block - the block to place
      Returns:
      a block rule
      Since:
      3.0.0
    • sequence

      @AsOf("3.0.0") static SequenceRuleSource sequence(List<RuleSource> rules)
      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

      @AsOf("3.0.0") static SequenceRuleSource sequence(RuleSource... rules)
      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

      @AsOf("3.0.0") static SequenceRuleSource.Builder sequence()
      Creates a new sequence rule source builder.
      Returns:
      a new sequence rule source builder
      Since:
      3.0.0
    • ifTrue

      @AsOf("3.0.0") static ConditionRuleSource ifTrue(ConditionSource condition, RuleSource then)
      Applies a rule only when a condition holds.
      Parameters:
      condition - the gating condition
      then - the rule to apply when the condition holds
      Returns:
      a conditional rule
      Since:
      3.0.0