Interface FindTopSurface

All Superinterfaces:
DensityFunction, Keyed, Registerable<FindTopSurface>, Wrapper

@NullMarked @AsOf("3.0.0") public interface FindTopSurface extends DensityFunction, Registerable<FindTopSurface>
Scans through a column of an input density and returns the topmost Y-level whose density is above 0. If no such position exists within the bounds, lowerBound() is returned.
Since:
3.0.0
See Also:
  • Method Details

    • density

      @AsOf("3.0.0") DensityFunction density()
      The density function to scan.
      Returns:
      the density function to scan
      Since:
      3.0.0
    • upperBound

      @AsOf("3.0.0") DensityFunction upperBound()
      The Y-level to start the scan at. Usually a 2D density function.
      Returns:
      the upper bound density function
      Since:
      3.0.0
    • lowerBound

      @AsOf("3.0.0") int lowerBound()
      The Y-level to stop the scan at, and the value returned when no surface is found.
      Returns:
      the lower bound
      Since:
      3.0.0
    • cellHeight

      @AsOf("3.0.0") int cellHeight()
      The resolution of the scan; e.g. if set to 4, only every 4th block is checked.
      Returns:
      the cell height
      Since:
      3.0.0
    • toBuilder

      @AsOf("3.0.0") default FindTopSurface.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 FindTopSurface of(@Nullable ResourceKey resourceKey, DensityFunction density, DensityFunction upperBound, int lowerBound, int cellHeight)
      Creates a new find top surface density function.
      Parameters:
      resourceKey - the resource key, or null
      density - the density function to scan
      upperBound - the Y-level to start the scan at
      lowerBound - the Y-level to stop the scan at
      cellHeight - the resolution of the scan
      Returns:
      a new find top surface density function
      Since:
      3.0.0
    • of

      @AsOf("3.0.0") static FindTopSurface of(DensityFunction density, DensityFunction upperBound, int lowerBound, int cellHeight)
      Creates a new find top surface density function.
      Parameters:
      density - the density function to scan
      upperBound - the Y-level to start the scan at
      lowerBound - the Y-level to stop the scan at
      cellHeight - the resolution of the scan
      Returns:
      a new find top surface density function
      Since:
      3.0.0
    • builder

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