Interface SurfaceCondition

All Superinterfaces:
Wrapper
All Known Implementing Classes:
SurfaceCondition.AbovePreliminarySurface, SurfaceCondition.Biome, SurfaceCondition.Hole, SurfaceCondition.Noise, SurfaceCondition.Not, SurfaceCondition.Steep, SurfaceCondition.StoneDepth, SurfaceCondition.Temperature, SurfaceCondition.VerticalGradient, SurfaceCondition.Water, SurfaceCondition.YCheck

Wraps the surface rule condition family (SurfaceRules.ConditionSource), the predicates that gate where a SurfaceRule applies.
Since:
2.4.0
  • Field Details

  • Method Details

    • toMinecraft

      @AsOf("2.4.0") default Object toMinecraft()
      Description copied from interface: Wrapper
      Convert this handle to the real Minecraft object.
      Specified by:
      toMinecraft in interface Wrapper
      Returns:
      the real Minecraft object
    • stoneDepth

      @AsOf("2.4.0") static SurfaceCondition stoneDepth(int offset, boolean addSurfaceDepth, SurfaceCondition.CaveSurface surfaceType)
      Matches within a given depth of stone from the floor or ceiling.
      Parameters:
      offset - the depth offset
      addSurfaceDepth - whether the biome surface depth is added to the offset
      surfaceType - the face to measure from
      Returns:
      a stone-depth condition
      Since:
      2.4.0
    • stoneDepth

      @AsOf("2.4.0") static SurfaceCondition stoneDepth(int offset, boolean addSurfaceDepth, int secondaryDepthRange, SurfaceCondition.CaveSurface surfaceType)
      Matches within a given depth of stone from the floor or ceiling, with a secondary depth range.
      Parameters:
      offset - the depth 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:
      2.4.0
    • not

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

      @AsOf("2.4.0") static SurfaceCondition 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:
      2.4.0
    • waterStartCheck

      @AsOf("2.4.0") static SurfaceCondition 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:
      2.4.0
    • isBiome

      @AsOf("2.4.0") static SurfaceCondition isBiome(List<ResourceKey> biomes)
      Matches when the current biome is one of the given biomes.
      Parameters:
      biomes - the biome keys to match
      Returns:
      a biome condition
      Since:
      2.4.0
    • noiseCondition

      @AsOf("2.4.0") static SurfaceCondition noiseCondition(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, inclusive
      Returns:
      a noise condition
      Since:
      2.4.0
    • noiseCondition

      @AsOf("2.4.0") static SurfaceCondition noiseCondition(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, inclusive
      maxThreshold - the upper threshold, inclusive
      Returns:
      a noise condition
      Since:
      2.4.0
    • yBlockCheck

      @AsOf("2.4.0") static SurfaceCondition 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 condition
      Since:
      2.4.0
    • yStartCheck

      @AsOf("2.4.0") static SurfaceCondition 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 condition
      Since:
      2.4.0
    • verticalGradient

      @AsOf("2.4.0") static SurfaceCondition 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:
      2.4.0
    • steep

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

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

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

      @AsOf("2.4.0") static SurfaceCondition temperature()
      Matches where the biome is cold enough to snow.
      Returns:
      a temperature condition
      Since:
      2.4.0