Record Class BlueprintElement.Cube

java.lang.Object
java.lang.Record
kr.toxicity.model.api.data.blueprint.BlueprintElement.Cube
Record Components:
name - the name of the cube
from - the starting coordinate (min corner)
to - the ending coordinate (max corner)
inflate - the inflation value
rotation - the rotation of the cube
origin - the pivot point of the cube
faces - the UV mapping for the faces
lightEmission - the light emission level (1-15 or null if 0)
visibility - whether the cube is visible
All Implemented Interfaces:
BlueprintElement
Enclosing interface:
BlueprintElement

public static record BlueprintElement.Cube(@NotNull String name, @NotNull Float3 from, @NotNull Float3 to, float inflate, @NotNull Float3 rotation, @NotNull Float3 origin, @Nullable ModelFace faces, @Nullable Integer lightEmission, boolean visibility) extends Record implements BlueprintElement
Represents a cube element, the basic building block of a model.
Since:
1.15.2
  • Constructor Details

    • Cube

      public Cube(@NotNull @NotNull String name, @NotNull @NotNull Float3 from, @NotNull @NotNull Float3 to, float inflate, @NotNull @NotNull Float3 rotation, @NotNull @NotNull Float3 origin, @Nullable @Nullable ModelFace faces, @Nullable @Nullable Integer lightEmission, boolean visibility)
      Creates an instance of a Cube record class.
      Parameters:
      name - the value for the name 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
      lightEmission - the value for the lightEmission record component
      visibility - the value for the visibility record component
  • Method Details

    • max

      public float max(@NotNull @NotNull Float3 origin)
      Calculates the maximum distance from the origin to any corner of the cube.
      Parameters:
      origin - the reference origin
      Returns:
      the maximum length
      Since:
      1.15.2
    • faces

      @NotNull public @NotNull ModelFace faces()
      Returns the value of the faces record component.
      Returns:
      the value of the faces record component
    • hasTexture

      public boolean hasTexture()
      Checks if this cube has any textures defined.
      Returns:
      true if it has textures, false otherwise
      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 the compare method from their corresponding wrapper classes.
      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
    • 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
    • inflate

      public float inflate()
      Returns the value of the inflate record component.
      Returns:
      the value of the inflate 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
    • origin

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

      @Nullable public @Nullable Integer lightEmission()
      Returns the value of the lightEmission record component.
      Returns:
      the value of the lightEmission 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