Interface ConstantSimpleFunction

All Superinterfaces:
DensityFunction, Keyed, Registerable<ConstantSimpleFunction>, SimpleFunction, Wrapper

@NullMarked @AsOf("3.0.0") public interface ConstantSimpleFunction extends SimpleFunction, Registerable<ConstantSimpleFunction>
A density function that always returns the same value.
Since:
3.0.0
  • Method Details

    • value

      @AsOf("3.0.0") double value()
      The constant value.
      Returns:
      the constant value
      Since:
      3.0.0
    • of

      @AsOf("3.0.0") static ConstantSimpleFunction of(@Nullable ResourceKey resourceKey, double value)
      Creates a new constant density function.
      Parameters:
      resourceKey - the resource key, or null
      value - the constant value
      Returns:
      the constant density function
      Since:
      3.0.0
    • of

      @AsOf("3.0.0") static ConstantSimpleFunction of(double value)
      Creates a new constant density function.
      Parameters:
      value - the constant value
      Returns:
      the constant density function
      Since:
      3.0.0