Package cn.nukkit.block.customblock.data
Record Class Transformation
java.lang.Object
java.lang.Record
cn.nukkit.block.customblock.data.Transformation
- All Implemented Interfaces:
NBTData
@PowerNukkitXOnly
@Since("1.19.80-r1")
public record Transformation(Vector3 translation, Vector3 scale, Vector3 rotation)
extends Record
implements NBTData
supports rotation, scaling, and translation. The component can be added to the whole block and/or to individual block permutations. Transformed geometries still have the same restrictions that non-transformed geometries have such as a maximum size of 30/16 units.
-
Constructor Summary
ConstructorDescriptionTransformation
(Vector3 translation, Vector3 scale, Vector3 rotation) Creates an instance of aTransformation
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.rotation()
Returns the value of therotation
record component.scale()
Returns the value of thescale
record component.final String
toString()
Returns a string representation of this record class.Returns the value of thetranslation
record component.
-
Constructor Details
-
Transformation
Creates an instance of aTransformation
record class.- Parameters:
translation
- the value for thetranslation
record componentscale
- the value for thescale
record componentrotation
- the value for therotation
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 withObjects::equals(Object,Object)
. -
translation
Returns the value of thetranslation
record component.- Returns:
- the value of the
translation
record component
-
scale
Returns the value of thescale
record component.- Returns:
- the value of the
scale
record component
-
rotation
Returns the value of therotation
record component.- Returns:
- the value of the
rotation
record component
-