Interface RangeChoice
- All Superinterfaces:
DensityFunction, Keyed, Registerable<RangeChoice>, Wrapper
@NullMarked
@AsOf("3.0.0")
public interface RangeChoice
extends DensityFunction, Registerable<RangeChoice>
Computes the input value and, depending on whether it falls within
[minInclusive, maxExclusive),
returns one of two other density functions. Essentially an if-then-else statement.- Since:
- 3.0.0
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic RangeChoice.Builderbuilder()Creates a new builder.input()The value to compare against the range.doubleThe upper bound of the range, exclusive.doubleThe lower bound of the range, inclusive.static RangeChoiceof(@Nullable ResourceKey resourceKey, DensityFunction input, double minInclusive, double maxExclusive, DensityFunction whenInRange, DensityFunction whenOutOfRange) Creates a new range choice density function.static RangeChoiceof(DensityFunction input, double minInclusive, double maxExclusive, DensityFunction whenInRange, DensityFunction whenOutOfRange) Creates a new range choice density function.default RangeChoice.BuilderConverts this object back to a builder.The density function used when the input is inside the range.The density function used when the input is outside the range.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
-
input
The value to compare against the range.- Returns:
- the input density function
- Since:
- 3.0.0
-
minInclusive
The lower bound of the range, inclusive.- Returns:
- the minimum inclusive value
- Since:
- 3.0.0
-
maxExclusive
The upper bound of the range, exclusive.- Returns:
- the maximum exclusive value
- Since:
- 3.0.0
-
whenInRange
The density function used when the input is inside the range.- Returns:
- the in-range density function
- Since:
- 3.0.0
-
whenOutOfRange
The density function used when the input is outside the range.- Returns:
- the out-of-range density function
- 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 RangeChoice of(@Nullable ResourceKey resourceKey, DensityFunction input, double minInclusive, double maxExclusive, DensityFunction whenInRange, DensityFunction whenOutOfRange) Creates a new range choice density function.- Parameters:
resourceKey- the resource key, or nullinput- the value to compare against the rangeminInclusive- the lower bound of the range, inclusivemaxExclusive- the upper bound of the range, exclusivewhenInRange- the density function used when the input is inside the rangewhenOutOfRange- the density function used when the input is outside the range- Returns:
- a new range choice density function
- Since:
- 3.0.0
-
of
@AsOf("3.0.0") static RangeChoice of(DensityFunction input, double minInclusive, double maxExclusive, DensityFunction whenInRange, DensityFunction whenOutOfRange) Creates a new range choice density function.- Parameters:
input- the value to compare against the rangeminInclusive- the lower bound of the range, inclusivemaxExclusive- the upper bound of the range, exclusivewhenInRange- the density function used when the input is inside the rangewhenOutOfRange- the density function used when the input is outside the range- Returns:
- a new range choice density function
- Since:
- 3.0.0
-
builder
Creates a new builder.- Returns:
- a new builder
- Since:
- 3.0.0
-