Interface StoneDepthConditionSource

All Superinterfaces:
ConditionSource, SurfaceRule, Wrapper

@NullMarked @AsOf("3.0.0") public interface StoneDepthConditionSource extends ConditionSource
Checks if the current position is within a specified distance from the surface, either upward or downward, using terrain depth. Used in vanilla to place grass blocks and dirt layers on the surface in the overworld, and soul sand, soul soil, gravel and basalt floors and ceilings in the nether.
Since:
3.0.0
See Also:
  • Method Details

    • offset

      @AsOf("3.0.0") int offset()
      The vertical offset.
      Returns:
      the offset
      Since:
      3.0.0
    • addSurfaceDepth

      @AsOf("3.0.0") boolean addSurfaceDepth()
      Whether the surface depth is added to the offset. Note: this is not add_stone_depth.
      Returns:
      whether the surface depth is added
      Since:
      3.0.0
    • secondaryDepthRange

      @AsOf("3.0.0") int secondaryDepthRange()
      Adds a mapped value of the secondary surface depth to the offset.
      Returns:
      the secondary depth range
      Since:
      3.0.0
    • surfaceType

      @AsOf("3.0.0") CaveSurface surfaceType()
      The face the depth is measured from.
      Returns:
      the surface type
      Since:
      3.0.0
    • toBuilder

      @AsOf("3.0.0") default StoneDepthConditionSource.Builder toBuilder()
      Converts this object back to a builder.
      Returns:
      a builder with the same values as this object
      Since:
      3.0.0
    • of

      @AsOf("3.0.0") static StoneDepthConditionSource of(int offset, boolean addSurfaceDepth, int secondaryDepthRange, CaveSurface surfaceType)
      Creates a new stone depth condition source.
      Parameters:
      offset - the vertical offset
      addSurfaceDepth - whether the surface depth is added to the offset
      secondaryDepthRange - the secondary depth range added to the offset
      surfaceType - the face the depth is measured from
      Returns:
      the stone depth condition source
      Since:
      3.0.0
    • of

      @AsOf("3.0.0") static StoneDepthConditionSource of(int offset, boolean addSurfaceDepth, CaveSurface surfaceType)
      Creates a new stone depth condition source without a secondary depth range.
      Parameters:
      offset - the vertical offset
      addSurfaceDepth - whether the surface depth is added to the offset
      surfaceType - the face the depth is measured from
      Returns:
      the stone depth condition source
      Since:
      3.0.0
    • builder

      @AsOf("3.0.0") static StoneDepthConditionSource.Builder builder()
      Creates a new builder.
      Returns:
      a new builder
      Since:
      3.0.0