Interface IntProvider

All Superinterfaces:
Comparable<ValueProvider>, ValueProvider, Wrapper
All Known Subinterfaces:
BiasedToBottomInt, ClampedInt, ClampedNormalInt, ConstantInt, TrapezoidInt, UniformInt, WeightedListInt

@NullMarked @AsOf("2.3.0") public interface IntProvider extends ValueProvider
A provider of an integer value.
Since:
2.3.0
See Also:
  • Method Details

    • minInclusive

      @AsOf("2.3.0") int 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") int maxInclusive()
      The largest value this provider can yield.
      Returns:
      the largest value this provider can yield.
      Since:
      2.3.0
    • clamp

      @AsOf("3.0.0") default ClampedInt clamp(int min, int max)
      Clamps the value to the given range.
      Parameters:
      min - the minimum value
      max - the maximum value
      Returns:
      a clamped int provider
      Since:
      3.0.0
    • constant

      @AsOf("2.3.0") static ConstantInt constant(int value)
      Creates a constant int provider.
      Parameters:
      value - the value to return
      Returns:
      a constant int provider
      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
    • uniform

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

      @AsOf("3.0.0") static UniformInt.Builder uniform()
      Creates a new uniform int builder.
      Returns:
      a new uniform int builder
      Since:
      3.0.0
    • biasedToBottom

      @AsOf("2.3.0") static BiasedToBottomInt biasedToBottom(int min, int max)
      Creates a biased-to-bottom int provider.
      Parameters:
      min - min inclusive
      max - max inclusive
      Returns:
      a biased-to-bottom int provider
      Since:
      2.3.0
    • biasedToBottom

      @AsOf("3.0.0") static BiasedToBottomInt.Builder biasedToBottom()
      Creates a new biased-to-bottom int builder.
      Returns:
      a new biased-to-bottom int builder
      Since:
      3.0.0
    • clampedNormal

      @AsOf("2.3.0") static ClampedNormalInt clampedNormal(int min, int max, float mean, float deviation)
      Creates a new clamped normal int.
      Parameters:
      min - min inclusive
      max - max inclusive
      mean - mean of the normal distribution
      deviation - deviation of the normal distribution
      Returns:
      a new clamped normal int
      Since:
      2.3.0
    • clampedNormal

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

      @AsOf("2.3.0") static TrapezoidInt trapezoid(int min, int max, int plateau)
      Creates a trapezoidal int provider.
      Parameters:
      min - min inclusive
      max - max inclusive
      plateau - the length of the range in the middle that has a uniform distribution
      Returns:
      the trapezoid int provider
      Since:
      2.3.0
    • triangle

      @AsOf("2.3.0") static TrapezoidInt triangle(int range)
      A symmetric triangular distribution over [-minInclusive(), maxInclusive()].
      Parameters:
      range - the range of the triangular distribution
      Returns:
      the trapezoid int provider
      Since:
      2.3.0
    • trapezoid

      @AsOf("3.0.0") static TrapezoidInt.Builder trapezoid()
      Creates a new trapezoid int builder.
      Returns:
      a new trapezoid int builder
      Since:
      3.0.0
    • clamped

      @AsOf("2.3.0") static ClampedInt clamped(IntProvider source, int min, int max)
      Creates a clamped int provider.
      Parameters:
      source - the source provider to clamp
      min - the minimum allowed value
      max - the maximum allowed value
      Returns:
      a clamped int provider
      Since:
      2.3.0
    • clamped

      @AsOf("3.0.0") static ClampedInt.Builder clamped()
      Creates a new clamped int builder.
      Returns:
      a new clamped int builder
      Since:
      3.0.0
    • weightedList

      @AsOf("2.3.0") static WeightedListInt weightedList(WeightedList<IntProvider> distribution)
      Creates a weighted list int provider.
      Parameters:
      distribution - the weighted pool of providers, which must not be empty
      Returns:
      a weighted list int provider
      Since:
      2.3.0
    • weightedList

      @AsOf("3.0.0") static WeightedListInt.Builder weightedList()
      Creates a new weighted list int builder.
      Returns:
      a new weighted list int builder
      Since:
      3.0.0
    • zero

      @AsOf("3.0.0") static ConstantInt zero()
      A constant int provider that always returns 0.
      Returns:
      a constant int provider that always returns 0
      Since:
      3.0.0
    • decode

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