All Known Implementing Classes:
GradientCurve.Exponential, GradientCurve.Linear, GradientCurve.Logarithmic, GradientCurve.Polynomial, GradientCurve.Sigmoid

A sealed interface representing a mathematical easing/scaling curve applied to a normalized position fraction t in [0.0, 1.0] within a GradientOutput.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    A normalized exponential curve (f(t) = (base^t - 1) / (base - 1)).
    static final record 
    A linear 1:1 gradient curve (f(t) = clamp(t, 0, 1)).
    static final record 
    A logarithmic curve (f(t) = ln(1 + baseMultiplier * t) / ln(1 + baseMultiplier)) that rises rapidly near 0.0 and flattens toward 1.0.
    static final record 
    A power/polynomial curve (f(t) = t^exponent).
    static final record 
    A logistic S-curve (f(t) = 1 / (1 + e^(-steepness * (t - midpoint)))) for sharp or smooth transitions.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<GradientCurve>
    Dispatch codec for serializing and deserializing any GradientCurve implementation based on its "type" field.
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    apply(float t)
    Applies the selected scaling curve to the provided normalized fraction t.
    Retrieves the unique string identifier for this curve type.
  • Field Details

    • CODEC

      static final com.mojang.serialization.Codec<GradientCurve> CODEC
      Dispatch codec for serializing and deserializing any GradientCurve implementation based on its "type" field.
  • Method Details

    • getTypeId

      String getTypeId()
      Retrieves the unique string identifier for this curve type.
      Returns:
      The curve type ID string.
    • apply

      float apply(float t)
      Applies the selected scaling curve to the provided normalized fraction t.
      Parameters:
      t - A float between 0.0 and 1.0 representing distance along the gradient.
      Returns:
      The scaled float representing the new weight mapped along the curve.