Record Class GravityBelt<T extends GravityFunction>

java.lang.Object
java.lang.Record
net.frozenblock.lib.gravity.api.GravityBelt<T>

public record GravityBelt<T extends GravityFunction>(double minY, double maxY, boolean renderBottom, boolean renderTop, T extends GravityFunction function) extends Record
  • Constructor Summary

    Constructors
    Constructor
    Description
    GravityBelt(double minY, double maxY, boolean renderBottom, boolean renderTop, T function)
    Creates an instance of a GravityBelt record class.
    GravityBelt(double minY, double maxY, T function)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    affectsPosition(double y)
     
    static <T extends SerializableGravityFunction<T>>
    com.mojang.serialization.Codec<GravityBelt<T>>
    codec(com.mojang.serialization.Codec<T> gravityFunction)
     
    static <T extends SerializableGravityFunction<T>>
    @Nullable com.mojang.serialization.Codec<GravityBelt<T>>
    codec(T gravityFunction)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    Returns the value of the function record component.
    final int
    Returns a hash code value for this object.
    double
    Returns the value of the maxY record component.
    double
    Returns the value of the minY record component.
    boolean
    Returns the value of the renderBottom record component.
    boolean
    Returns the value of the renderTop record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • GravityBelt

      public GravityBelt(double minY, double maxY, T function)
    • GravityBelt

      public GravityBelt(double minY, double maxY, boolean renderBottom, boolean renderTop, T function)
      Creates an instance of a GravityBelt record class.
      Parameters:
      minY - the value for the minY record component
      maxY - the value for the maxY record component
      renderBottom - the value for the renderBottom record component
      renderTop - the value for the renderTop record component
      function - the value for the function record component
  • Method Details

    • affectsPosition

      public boolean affectsPosition(double y)
    • codec

      public static <T extends SerializableGravityFunction<T>> com.mojang.serialization.Codec<GravityBelt<T>> codec(com.mojang.serialization.Codec<T> gravityFunction)
    • codec

      @Nullable public static <T extends SerializableGravityFunction<T>> @Nullable com.mojang.serialization.Codec<GravityBelt<T>> codec(T gravityFunction)
    • 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.
    • minY

      public double minY()
      Returns the value of the minY record component.
      Returns:
      the value of the minY record component
    • maxY

      public double maxY()
      Returns the value of the maxY record component.
      Returns:
      the value of the maxY record component
    • renderBottom

      public boolean renderBottom()
      Returns the value of the renderBottom record component.
      Returns:
      the value of the renderBottom record component
    • renderTop

      public boolean renderTop()
      Returns the value of the renderTop record component.
      Returns:
      the value of the renderTop record component
    • function

      public T function()
      Returns the value of the function record component.
      Returns:
      the value of the function record component