Package cn.nukkit.block.customblock.data
Record Class CollisionBox
java.lang.Object
java.lang.Record
cn.nukkit.block.customblock.data.CollisionBox
- All Implemented Interfaces:
NBTData
@PowerNukkitXOnly
@Since("1.19.60-r1")
public record CollisionBox(double originX, double originY, double originZ, double sizeX, double sizeY, double sizeZ)
extends Record
implements NBTData
-
Constructor Summary
ConstructorDescriptionCollisionBox
(double originX, double originY, double originZ, double sizeX, double sizeY, double sizeZ) Creates an instance of aCollisionBox
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.double
originX()
Returns the value of theoriginX
record component.double
originY()
Returns the value of theoriginY
record component.double
originZ()
Returns the value of theoriginZ
record component.double
sizeX()
Returns the value of thesizeX
record component.double
sizeY()
Returns the value of thesizeY
record component.double
sizeZ()
Returns the value of thesizeZ
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
CollisionBox
public CollisionBox(double originX, double originY, double originZ, double sizeX, double sizeY, double sizeZ) Creates an instance of aCollisionBox
record class.- Parameters:
originX
- the value for theoriginX
record componentoriginY
- the value for theoriginY
record componentoriginZ
- the value for theoriginZ
record componentsizeX
- the value for thesizeX
record componentsizeY
- the value for thesizeY
record componentsizeZ
- the value for thesizeZ
record component
-
-
Method Details
-
toCompoundTag
- Specified by:
toCompoundTag
in interfaceNBTData
-
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 double originX()Returns the value of theoriginX
record component.- Returns:
- the value of the
originX
record component
-
originY
public double originY()Returns the value of theoriginY
record component.- Returns:
- the value of the
originY
record component
-
originZ
public double originZ()Returns the value of theoriginZ
record component.- Returns:
- the value of the
originZ
record component
-
sizeX
public double sizeX()Returns the value of thesizeX
record component.- Returns:
- the value of the
sizeX
record component
-
sizeY
public double sizeY()Returns the value of thesizeY
record component.- Returns:
- the value of the
sizeY
record component
-
sizeZ
public double sizeZ()Returns the value of thesizeZ
record component.- Returns:
- the value of the
sizeZ
record component
-