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 Details

    • Transformation

      public Transformation(Vector3 translation, Vector3 scale, Vector3 rotation)
      Creates an instance of a Transformation record class.
      Parameters:
      translation - the value for the translation record component
      scale - the value for the scale record component
      rotation - the value for the rotation record component
  • Method Details

    • toCompoundTag

      public CompoundTag toCompoundTag()
      Specified by:
      toCompoundTag in interface NBTData
    • 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 Objects::equals(Object,Object).
      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.
    • translation

      public Vector3 translation()
      Returns the value of the translation record component.
      Returns:
      the value of the translation record component
    • scale

      public Vector3 scale()
      Returns the value of the scale record component.
      Returns:
      the value of the scale record component
    • rotation

      public Vector3 rotation()
      Returns the value of the rotation record component.
      Returns:
      the value of the rotation record component