Record Class ModelElement

java.lang.Object
java.lang.Record
kr.toxicity.model.api.data.raw.ModelElement
Record Components:
name - name
type - type
uuid - cube's uuid
from - min-position
to - max-position
inflate - inflate
rotation - rotation
origin - origin
faces - uv
_visibility - visibility

@Internal public record ModelElement(@NotNull String name, @Nullable ModelElement.Type type, @NotNull String uuid, @Nullable Float3 from, @Nullable Float3 to, float inflate, @Nullable Float3 rotation, @NotNull Float3 origin, @Nullable ModelFace faces, @Nullable Boolean _visibility) extends Record
A raw model's element (cube).
  • Constructor Details

    • ModelElement

      public ModelElement(@NotNull @NotNull String name, @Nullable @Nullable ModelElement.Type type, @NotNull @NotNull String uuid, @Nullable @Nullable Float3 from, @Nullable @Nullable Float3 to, float inflate, @Nullable @Nullable Float3 rotation, @NotNull @NotNull Float3 origin, @Nullable @Nullable ModelFace faces, @Nullable @Nullable Boolean _visibility)
      Creates an instance of a ModelElement record class.
      Parameters:
      name - the value for the name record component
      type - the value for the type record component
      uuid - the value for the uuid record component
      from - the value for the from record component
      to - the value for the to record component
      inflate - the value for the inflate record component
      rotation - the value for the rotation record component
      origin - the value for the origin record component
      faces - the value for the faces record component
      _visibility - the value for the _visibility record component
  • Method Details

    • max

      public float max()
      Gets max length of this cube
      Returns:
      cube length
    • from

      @NotNull public @NotNull Float3 from()
      Returns the value of the from record component.
      Returns:
      the value of the from record component
    • to

      @NotNull public @NotNull Float3 to()
      Returns the value of the to record component.
      Returns:
      the value of the to record component
    • visibility

      public boolean visibility()
    • rotation

      @NotNull public @NotNull Float3 rotation()
      Returns the value of the rotation record component.
      Returns:
      the value of the rotation record component
    • type

      @NotNull public @NotNull ModelElement.Type type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • hasTexture

      public boolean hasTexture()
      Checks this model has texture
      Returns:
      model has texture
    • isSupported

      public boolean isSupported()
      Checks this element is supported in the Minecraft client.
      Returns:
      supported
    • 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.
    • name

      @NotNull public @NotNull String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • uuid

      @NotNull public @NotNull String uuid()
      Returns the value of the uuid record component.
      Returns:
      the value of the uuid record component
    • inflate

      public float inflate()
      Returns the value of the inflate record component.
      Returns:
      the value of the inflate record component
    • origin

      @NotNull public @NotNull Float3 origin()
      Returns the value of the origin record component.
      Returns:
      the value of the origin record component
    • faces

      @Nullable public @Nullable ModelFace faces()
      Returns the value of the faces record component.
      Returns:
      the value of the faces record component
    • _visibility

      @SerializedName("visibility") @Nullable public @Nullable Boolean _visibility()
      Returns the value of the _visibility record component.
      Returns:
      the value of the _visibility record component