Interface FloatProvider

All Superinterfaces:
Comparable<ValueProvider>, ValueProvider, Wrapper
All Known Subinterfaces:
ClampedNormalFloat, ConstantFloat, TrapezoidFloat, UniformFloat

@NullMarked @AsOf("2.3.0") public interface FloatProvider extends ValueProvider
A provider of a floating-point value.
Since:
2.3.0
See Also:
  • Method Details

    • minInclusive

      @AsOf("2.3.0") float minInclusive()
      The smallest value this provider can yield.
      Returns:
      the smallest value this provider can yield.
      Since:
      2.3.0
    • maxInclusive

      @AsOf("2.3.0") float 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: ValueProvider
      The smallest value this provider can yield, as a double.
      Specified by:
      min in interface ValueProvider
      Returns:
      the smallest value this provider can yield
    • max

      default double max()
      Description copied from interface: ValueProvider
      The largest value this provider can yield, as a double.
      Specified by:
      max in interface ValueProvider
      Returns:
      the largest value this provider can yield
    • constant

      @AsOf("2.3.0") static ConstantFloat constant(float value)
      Creates a constant float provider.
      Parameters:
      value - the value to return
      Returns:
      a constant float provider
      Since:
      2.3.0
    • uniform

      @AsOf("2.3.0") static UniformFloat uniform(float min, float max)
      Creates a uniform float provider.
      Parameters:
      min - min inclusive
      max - max exclusive
      Returns:
      a uniform float provider
      Since:
      2.3.0
    • uniform

      @AsOf("3.0.0") static UniformFloat.Builder 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 distribution
      deviation - the deviation of the normal distribution
      min - the minimum value to clamp to
      max - the maximum value to clamp to
      Returns:
      a clamped normal float provider
      Since:
      2.3.0
    • clampedNormal

      @AsOf("3.0.0") static ClampedNormalFloat.Builder clampedNormal()
      Creates a new clamped normal float builder.
      Returns:
      a new clamped normal float builder
      Since:
      3.0.0
    • trapezoid

      @AsOf("2.3.0") static TrapezoidFloat trapezoid(float min, float max, float plateau)
      Creates a trapezoidal float provider.
      Parameters:
      min - the minimum value
      max - the maximum value
      plateau - the range in the middle that has a uniform distribution
      Returns:
      a trapezoid float provider
      Since:
      2.3.0
    • trapezoid

      @AsOf("3.0.0") static TrapezoidFloat.Builder trapezoid()
      Creates a new trapezoid float builder.
      Returns:
      a new trapezoid float builder
      Since:
      3.0.0
    • decode

      @AsOf("3.3.0") static FloatProvider decode(Object minecraftFloatProvider)
      Reads a Minecraft float provider into a wrapper.
      Parameters:
      minecraftFloatProvider - the float provider to read
      Returns:
      the wrapper for it
      Since:
      3.3.0