Record Class BlueprintElement.Group

java.lang.Object
java.lang.Record
kr.toxicity.model.api.data.blueprint.BlueprintElement.Group
Record Components:
uuid - the UUID of the group
name - the name of the group/bone
origin - the pivot point of the group
rotation - the rotation of the group
children - the list of child elements
visibility - whether the group is visible
All Implemented Interfaces:
BlueprintElement, BlueprintElement.Bone
Enclosing interface:
BlueprintElement

public static record BlueprintElement.Group(@NotNull UUID uuid, @NotNull BoneName name, @NotNull Float3 origin, @NotNull Float3 rotation, @NotNull List<BlueprintElement> children, boolean visibility) extends Record implements BlueprintElement.Bone
Represents a group of elements, forming a bone in the hierarchy.
Since:
1.15.2
  • Constructor Details

    • Group

      public Group(@NotNull @NotNull UUID uuid, @NotNull @NotNull BoneName name, @NotNull @NotNull Float3 origin, @NotNull @NotNull Float3 rotation, @NotNull @NotNull List<BlueprintElement> children, boolean visibility)
      Creates an instance of a Group record class.
      Parameters:
      uuid - the value for the uuid record component
      name - the value for the name record component
      origin - the value for the origin record component
      rotation - the value for the rotation record component
      children - the value for the children record component
      visibility - the value for the visibility record component
  • Method Details

    • origin

      @NotNull public @NotNull Float3 origin()
      Returns the origin with inverted X and Z axes.
      Specified by:
      origin in interface BlueprintElement.Bone
      Returns:
      the inverted origin
      Since:
      1.15.2
    • buildLegacyJson

      @Nullable public @Nullable BlueprintJson buildLegacyJson(boolean skipLog, @NotNull PackObfuscator.Pair obfuscator, @NotNull @NotNull ModelBlueprint parent)
      Builds the JSON representation for legacy clients (1.21.3 or under).
      Parameters:
      skipLog - whether to skip logging warnings for invalid rotations
      obfuscator - the obfuscator for model and texture names
      parent - the parent model blueprint
      Returns:
      the generated blueprint JSON, or null if not applicable
      Since:
      1.15.2
    • buildModernJson

      @Nullable public @Nullable @Unmodifiable List<BlueprintJson> buildModernJson(@NotNull PackObfuscator.Pair obfuscator, @NotNull @NotNull ModelBlueprint parent)
      Builds the JSON representation for modern clients.
      Parameters:
      obfuscator - the obfuscator for model and texture names
      parent - the parent model blueprint
      Returns:
      a list of generated blueprint JSONs, or null if not applicable
      Since:
      1.15.2
    • scale

      public float scale()
      Calculates the required scale for the cubes in this group.
      Returns:
      the scale factor
      Since:
      1.15.2
    • hitBox

      @Nullable public @Nullable ModelBoundingBox hitBox()
      Calculates the bounding box for this group to be used as a hitbox.
      Returns:
      the named bounding box, or null if no cubes are present
      Since:
      1.15.2
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components 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.
    • uuid

      @NotNull public @NotNull UUID uuid()
      Returns the value of the uuid record component.
      Specified by:
      uuid in interface BlueprintElement.Bone
      Returns:
      the value of the uuid record component
    • name

      @NotNull public @NotNull BoneName name()
      Returns the value of the name record component.
      Specified by:
      name in interface BlueprintElement.Bone
      Returns:
      the value of the name record component
    • rotation

      @NotNull public @NotNull Float3 rotation()
      Returns the value of the rotation record component.
      Specified by:
      rotation in interface BlueprintElement
      Returns:
      the value of the rotation record component
    • children

      @NotNull public @NotNull List<BlueprintElement> children()
      Returns the value of the children record component.
      Returns:
      the value of the children record component
    • visibility

      public boolean visibility()
      Returns the value of the visibility record component.
      Specified by:
      visibility in interface BlueprintElement
      Returns:
      the value of the visibility record component