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 boxoriginY- The origin Y of the boxoriginZ- The origin Z of the boxsizeX- The size X of the boxsizeY- The size Y of the boxsizeZ- 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
ConstructorsConstructorDescriptionBoxComponent(float originX, float originY, float originZ, float sizeX, float sizeY, float sizeZ) Creates an instance of aBoxComponentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic BoxComponentemptyBox()Gets an empty box componentfinal booleanIndicates whether some other object is "equal to" this one.static BoxComponentfullBox()Gets a full box componentfinal inthashCode()Returns a hash code value for this object.booleanisEmpty()Gets if the box component is emptyfloatoriginX()Returns the value of theoriginXrecord component.floatoriginY()Returns the value of theoriginYrecord component.floatoriginZ()Returns the value of theoriginZrecord component.floatsizeX()Returns the value of thesizeXrecord component.floatsizeY()Returns the value of thesizeYrecord component.floatsizeZ()Returns the value of thesizeZrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
BoxComponent
public BoxComponent(float originX, float originY, float originZ, float sizeX, float sizeY, float sizeZ) Creates an instance of aBoxComponentrecord class.- Parameters:
originX- the value for theoriginXrecord componentoriginY- the value for theoriginYrecord componentoriginZ- the value for theoriginZrecord componentsizeX- the value for thesizeXrecord componentsizeY- the value for thesizeYrecord componentsizeZ- the value for thesizeZrecord component
-
-
Method Details
-
fullBox
Gets a full box component- Returns:
- A full box component
-
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
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. -
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. -
equals
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 '=='. -
originX
public float originX()Returns the value of theoriginXrecord component.- Returns:
- the value of the
originXrecord component
-
originY
public float originY()Returns the value of theoriginYrecord component.- Returns:
- the value of the
originYrecord component
-
originZ
public float originZ()Returns the value of theoriginZrecord component.- Returns:
- the value of the
originZrecord component
-
sizeX
public float sizeX()Returns the value of thesizeXrecord component.- Returns:
- the value of the
sizeXrecord component
-
sizeY
public float sizeY()Returns the value of thesizeYrecord component.- Returns:
- the value of the
sizeYrecord component
-
sizeZ
public float sizeZ()Returns the value of thesizeZrecord component.- Returns:
- the value of the
sizeZrecord component
-