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 groupname- the name of the group/boneorigin- the pivot point of the grouprotation- the rotation of the groupchildren- the list of child elementsvisibility- 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
-
Nested Class Summary
Nested classes/interfaces inherited from interface BlueprintElement
BlueprintElement.Bone, BlueprintElement.Camera, BlueprintElement.Cube, BlueprintElement.Group, BlueprintElement.Locator, BlueprintElement.Mesh, BlueprintElement.NullObject -
Field Summary
Fields inherited from interface BlueprintElement
MESH_PIXEL, MESH_TRIANGLE_DUPLEX, MESH_TRIANGLE_SINGLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable BlueprintJsonbuildLegacyJson(PackObfuscator.Pair obfuscator, @NotNull BlueprintLoadContext context) Builds the JSON representation for legacy clients (1.21.3 or under).@Nullable com.google.gson.JsonObjectbuildMeshItemModel(@NotNull BlueprintLoadContext context) Builds the JSON representation for a mesh-based item model.@Nullable @Unmodifiable List<BlueprintJson> buildModernJson(PackObfuscator.Pair obfuscator, @NotNull BlueprintLoadContext context) Builds the JSON representation for modern clients.@NotNull List<BlueprintElement> children()Returns the value of thechildrenrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable ModelBoundingBoxhitBox()Calculates the bounding box for this group to be used as a hitbox.@NotNull BoneNamename()Returns the value of thenamerecord component.@NotNull Float3origin()Returns the origin with inverted X and Z axes.@NotNull Float3rotation()Returns the value of therotationrecord component.floatscale()Calculates the required scale for the cubes in this group.final StringtoString()Returns a string representation of this record class.@NotNull UUIDuuid()Returns the value of theuuidrecord component.booleanReturns the value of thevisibilityrecord component.
-
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 aGrouprecord class.- Parameters:
uuid- the value for theuuidrecord componentname- the value for thenamerecord componentorigin- the value for theoriginrecord componentrotation- the value for therotationrecord componentchildren- the value for thechildrenrecord componentvisibility- the value for thevisibilityrecord component
-
-
Method Details
-
origin
Returns the origin with inverted X and Z axes.- Specified by:
originin interfaceBlueprintElement.Bone- Returns:
- the inverted origin
- Since:
- 1.15.2
-
buildLegacyJson
@Nullable public @Nullable BlueprintJson buildLegacyJson(@NotNull PackObfuscator.Pair obfuscator, @NotNull @NotNull BlueprintLoadContext context) Builds the JSON representation for legacy clients (1.21.3 or under).- Parameters:
obfuscator- the obfuscator for model and texture namescontext- the load context- 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 BlueprintLoadContext context) Builds the JSON representation for modern clients.- Parameters:
obfuscator- the obfuscator for model and texture namescontext- the load context- Returns:
- a list of generated blueprint JSONs, or null if not applicable
- Since:
- 1.15.2
-
buildMeshItemModel
@Nullable public @Nullable com.google.gson.JsonObject buildMeshItemModel(@NotNull @NotNull BlueprintLoadContext context) Builds the JSON representation for a mesh-based item model.- Parameters:
context- the load context- Returns:
- the generated mesh JSON, or null if no meshes are present
- Since:
- 3.0.0
-
scale
public float scale()Calculates the required scale for the cubes in this group.- Returns:
- the scale factor
- Since:
- 1.15.2
-
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
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
uuid
Returns the value of theuuidrecord component.- Specified by:
uuidin interfaceBlueprintElement.Bone- Returns:
- the value of the
uuidrecord component
-
name
Returns the value of thenamerecord component.- Specified by:
namein interfaceBlueprintElement.Bone- Returns:
- the value of the
namerecord component
-
rotation
Returns the value of therotationrecord component.- Specified by:
rotationin interfaceBlueprintElement- Returns:
- the value of the
rotationrecord component
-
children
-
visibility
public boolean visibility()Returns the value of thevisibilityrecord component.- Specified by:
visibilityin interfaceBlueprintElement- Returns:
- the value of the
visibilityrecord component
-