Record Class BoxComponent

java.lang.Object
java.lang.Record
org.geysermc.geyser.api.block.custom.component.BoxComponent
Record Components:
originX - The origin X of the box
originY - The origin Y of the box
originZ - The origin Z of the box
sizeX - The size X of the box
sizeY - The size Y of the box
sizeZ - The size Z of the box

public record BoxComponent(float originX, float originY, float originZ, float sizeX, float sizeY, float sizeZ) extends Record
This class is used to store a box component for the selection and collision boxes of a custom block.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BoxComponent(float originX, float originY, float originZ, float sizeX, float sizeY, float sizeZ)
    Creates an instance of a BoxComponent record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets an empty box component
    final boolean
    Indicates whether some other object is "equal to" this one.
    Gets a full box component
    final int
    Returns a hash code value for this object.
    boolean
    Gets if the box component is empty
    float
    Returns the value of the originX record component.
    float
    Returns the value of the originY record component.
    float
    Returns the value of the originZ record component.
    float
    Returns the value of the sizeX record component.
    float
    Returns the value of the sizeY record component.
    float
    Returns the value of the sizeZ 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

    • BoxComponent

      public BoxComponent(float originX, float originY, float originZ, float sizeX, float sizeY, float sizeZ)
      Creates an instance of a BoxComponent record class.
      Parameters:
      originX - the value for the originX record component
      originY - the value for the originY record component
      originZ - the value for the originZ record component
      sizeX - the value for the sizeX record component
      sizeY - the value for the sizeY record component
      sizeZ - the value for the sizeZ record component
  • Method Details

    • fullBox

      public static BoxComponent fullBox()
      Gets a full box component
      Returns:
      A full box component
    • emptyBox

      public static BoxComponent emptyBox()
      Gets an empty box component
      Returns:
      An empty box component
    • isEmpty

      public boolean isEmpty()
      Gets if the box component is empty
      Returns:
      If the box component is empty.
    • 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. All components in this record class 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.
    • originX

      public float originX()
      Returns the value of the originX record component.
      Returns:
      the value of the originX record component
    • originY

      public float originY()
      Returns the value of the originY record component.
      Returns:
      the value of the originY record component
    • originZ

      public float originZ()
      Returns the value of the originZ record component.
      Returns:
      the value of the originZ record component
    • sizeX

      public float sizeX()
      Returns the value of the sizeX record component.
      Returns:
      the value of the sizeX record component
    • sizeY

      public float sizeY()
      Returns the value of the sizeY record component.
      Returns:
      the value of the sizeY record component
    • sizeZ

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