Interface FloatProvider
- All Superinterfaces:
Comparable<ValueProvider>, ValueProvider, Wrapper
- All Known Subinterfaces:
ClampedNormalFloat, ConstantFloat, TrapezoidFloat, UniformFloat
A provider of a floating-point value.
- Since:
- 2.3.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classFloatProvider.FloatProviderBuilder<T extends FloatProvider, S extends FloatProvider.FloatProviderBuilder<T,S>> Common abstract builder for float providers with inclusive bounds. -
Method Summary
Modifier and TypeMethodDescriptionstatic ClampedNormalFloat.BuilderCreates a new clamped normal float builder.static ClampedNormalFloatclampedNormal(float mean, float deviation, float min, float max) Creates a clamped normal float provider.static ConstantFloatconstant(float value) Creates a constant float provider.static FloatProviderReads a Minecraft float provider into a wrapper.default doublemax()The largest value this provider can yield, as a double.floatThe largest value this provider can yield.default doublemin()The smallest value this provider can yield, as a double.floatThe smallest value this provider can yield.static TrapezoidFloat.BuilderCreates a new trapezoid float builder.static TrapezoidFloattrapezoid(float min, float max, float plateau) Creates a trapezoidal float provider.static UniformFloat.Builderuniform()Creates a new uniform float builder.static UniformFloatuniform(float min, float max) Creates a uniform float provider.Methods inherited from interface ValueProvider
compareToMethods inherited from interface Wrapper
asHandle, toMinecraft, unwrap
-
Method Details
-
minInclusive
The smallest value this provider can yield.- Returns:
- the smallest value this provider can yield.
- Since:
- 2.3.0
-
maxInclusive
The largest value this provider can yield.- Returns:
- the largest value this provider can yield.
- Since:
- 2.3.0
-
min
default double min()Description copied from interface:ValueProviderThe smallest value this provider can yield, as a double.- Specified by:
minin interfaceValueProvider- Returns:
- the smallest value this provider can yield
-
max
default double max()Description copied from interface:ValueProviderThe largest value this provider can yield, as a double.- Specified by:
maxin interfaceValueProvider- Returns:
- the largest value this provider can yield
-
constant
Creates a constant float provider.- Parameters:
value- the value to return- Returns:
- a constant float provider
- Since:
- 2.3.0
-
uniform
Creates a uniform float provider.- Parameters:
min- min inclusivemax- max exclusive- Returns:
- a uniform float provider
- Since:
- 2.3.0
-
uniform
Creates a new uniform float builder.- Returns:
- a new uniform float builder
- Since:
- 3.0.0
-
clampedNormal
@AsOf("2.3.0") static ClampedNormalFloat clampedNormal(float mean, float deviation, float min, float max) Creates a clamped normal float provider.- Parameters:
mean- the mean of the normal distributiondeviation- the deviation of the normal distributionmin- the minimum value to clamp tomax- the maximum value to clamp to- Returns:
- a clamped normal float provider
- Since:
- 2.3.0
-
clampedNormal
Creates a new clamped normal float builder.- Returns:
- a new clamped normal float builder
- Since:
- 3.0.0
-
trapezoid
Creates a trapezoidal float provider.- Parameters:
min- the minimum valuemax- the maximum valueplateau- the range in the middle that has a uniform distribution- Returns:
- a trapezoid float provider
- Since:
- 2.3.0
-
trapezoid
Creates a new trapezoid float builder.- Returns:
- a new trapezoid float builder
- Since:
- 3.0.0
-
decode
Reads a Minecraft float provider into a wrapper.- Parameters:
minecraftFloatProvider- the float provider to read- Returns:
- the wrapper for it
- Since:
- 3.3.0
-