Record Class TrapezoidFloat

java.lang.Object
java.lang.Record
net.minecraft.util.valueproviders.TrapezoidFloat
All Implemented Interfaces:
FloatProvider, SampledFloat

public record TrapezoidFloat(float min, float max, float plateau) extends Record implements FloatProvider
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final MapCodec<TrapezoidFloat>
     
    private final float
    The field for the max record component.
    private final float
    The field for the min record component.
    private final float
    The field for the plateau record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TrapezoidFloat(float min, float max, float plateau)
    Creates an instance of a TrapezoidFloat record class.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    float
    max()
    Returns the value of the max record component.
    float
    min()
    Returns the value of the min record component.
    of(float min, float max, float plateau)
     
    float
    Returns the value of the plateau record component.
    float
     
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • min

      private final float min
      The field for the min record component.
    • max

      private final float max
      The field for the max record component.
    • plateau

      private final float plateau
      The field for the plateau record component.
    • MAP_CODEC

      public static final MapCodec<TrapezoidFloat> MAP_CODEC
  • Constructor Details

    • TrapezoidFloat

      public TrapezoidFloat(float min, float max, float plateau)
      Creates an instance of a TrapezoidFloat record class.
      Parameters:
      min - the value for the min record component
      max - the value for the max record component
      plateau - the value for the plateau record component
  • Method Details

    • of

      public static TrapezoidFloat of(float min, float max, float plateau)
    • sample

      public float sample(RandomSource random)
      Specified by:
      sample in interface SampledFloat
    • codec

      public MapCodec<TrapezoidFloat> codec()
      Specified by:
      codec in interface FloatProvider
    • toString

      public 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. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      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.
    • min

      public float min()
      Returns the value of the min record component.
      Specified by:
      min in interface FloatProvider
      Returns:
      the value of the min record component
    • max

      public float max()
      Returns the value of the max record component.
      Specified by:
      max in interface FloatProvider
      Returns:
      the value of the max record component
    • plateau

      public float plateau()
      Returns the value of the plateau record component.
      Returns:
      the value of the plateau record component