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:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic FindTopSurface.Builderbuilder()Creates a new builder.intThe resolution of the scan; e.g.density()The density function to scan.intThe Y-level to stop the scan at, and the value returned when no surface is found.static FindTopSurfaceof(@Nullable ResourceKey resourceKey, DensityFunction density, DensityFunction upperBound, int lowerBound, int cellHeight) Creates a new find top surface density function.static FindTopSurfaceof(DensityFunction density, DensityFunction upperBound, int lowerBound, int cellHeight) Creates a new find top surface density function.default FindTopSurface.BuilderConverts this object back to a builder.The Y-level to start the scan at.Methods inherited from interface DensityFunction
abs, add, blendDensity, cache2d, cacheAllInCell, cacheOnce, clamp, cube, findTopSurface, flatCache, halfNegative, interpolated, invert, max, min, mul, quarterNegative, rangeChoice, resourceKey, square, squeeze, wrapMethods inherited from interface Registerable
registerMethods inherited from interface Wrapper
asHandle, toMinecraft, unwrap
-
Method Details
-
density
The density function to scan.- Returns:
- the density function to scan
- Since:
- 3.0.0
-
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
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
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
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 nulldensity- the density function to scanupperBound- the Y-level to start the scan atlowerBound- the Y-level to stop the scan atcellHeight- 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 scanupperBound- the Y-level to start the scan atlowerBound- the Y-level to stop the scan atcellHeight- the resolution of the scan- Returns:
- a new find top surface density function
- Since:
- 3.0.0
-
builder
Creates a new builder.- Returns:
- a new builder
- Since:
- 3.0.0
-