Record Class DensityFunctions.Spline

java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.DensityFunctions.Spline
All Implemented Interfaces:
DensityFunction
Enclosing class:
DensityFunctions

public static record DensityFunctions.Spline(CubicSpline<TerrainShaper.PointCustom> spline, double minValue, double maxValue) extends Record implements DensityFunction
  • Field Details

    • spline

      private final CubicSpline<TerrainShaper.PointCustom> spline
      The field for the spline record component.
    • minValue

      private final double minValue
      The field for the minValue record component.
    • maxValue

      private final double maxValue
      The field for the maxValue record component.
    • DATA_CODEC

      private static final com.mojang.serialization.MapCodec<DensityFunctions.Spline> DATA_CODEC
    • CODEC

      public static final com.mojang.serialization.Codec<DensityFunctions.Spline> CODEC
  • Constructor Details

    • Spline

      public Spline(CubicSpline<TerrainShaper.PointCustom> spline, double minValue, double maxValue)
      Creates an instance of a Spline record class.
      Parameters:
      spline - the value for the spline record component
      minValue - the value for the minValue record component
      maxValue - the value for the maxValue record component
  • Method Details

    • compute

      public double compute(DensityFunction.FunctionContext p_211715_)
      Specified by:
      compute in interface DensityFunction
    • fillArray

      public void fillArray(double[] p_211722_, DensityFunction.ContextProvider p_211723_)
      Specified by:
      fillArray in interface DensityFunction
    • mapAll

      public DensityFunction mapAll(DensityFunction.Visitor p_211717_)
      Specified by:
      mapAll in interface DensityFunction
    • codec

      public com.mojang.serialization.Codec<? extends DensityFunction> codec()
      Specified by:
      codec in interface DensityFunction
    • minValue

      public double minValue()
      Returns the value of the minValue record component.
      Specified by:
      minValue in interface DensityFunction
      Returns:
      the value of the minValue record component
    • maxValue

      public double maxValue()
      Returns the value of the maxValue record component.
      Specified by:
      maxValue in interface DensityFunction
      Returns:
      the value of the maxValue record component
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • spline

      Returns the value of the spline record component.
      Returns:
      the value of the spline record component