Interface ClampedNormalFloat
- All Superinterfaces:
Comparable<ValueProvider>, FloatProvider, ValueProvider, Wrapper
Clamped normal samples a bell curve centered at mean with spread deviation,
then forces the result into [
FloatProvider.minInclusive(), FloatProvider.maxInclusive()].
Anything outside gets snapped to the nearest bound rather than rerolled.- Since:
- 3.0.0
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface FloatProvider
FloatProvider.FloatProviderBuilder<T,S> -
Method Summary
Modifier and TypeMethodDescriptionstatic ClampedNormalFloat.Builderbuilder()Creates a new builder.floatThe deviation of the normal distribution.floatmean()The mean of the normal distribution.static ClampedNormalFloatof(float min, float max, float mean, float deviation) Creates a new ClampedNormalFloat.default ClampedNormalFloat.BuilderConverts this object back to a builder.Methods inherited from interface FloatProvider
max, maxInclusive, min, minInclusiveMethods inherited from interface ValueProvider
compareToMethods inherited from interface Wrapper
asHandle, toMinecraft, unwrap
-
Method Details
-
mean
The mean of the normal distribution.- Returns:
- the mean of the normal distribution
- Since:
- 3.0.0
-
deviation
The deviation of the normal distribution.- Returns:
- the deviation of the normal distribution
- 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
Creates a new ClampedNormalFloat.- Parameters:
min- the minimum value to clamp tomax- the maximum value to clamp tomean- the mean of the normal distributiondeviation- the deviation of the normal distribution- Returns:
- the ClampedNormalFloat
- Since:
- 3.0.0
-
builder
Creates a new builder.- Returns:
- a new builder
- Since:
- 3.0.0
-