Record Class BlueprintTexture

java.lang.Object
java.lang.Record
kr.toxicity.model.api.data.blueprint.BlueprintTexture
Record Components:
name - texture name
image - image
width - original width
height - original height
uvWidth - uv width
uvHeight - uv height

public record BlueprintTexture(@NotNull String name, byte[] image, int width, int height, int uvWidth, int uvHeight) extends Record
Texture of the model
  • Constructor Details

    • BlueprintTexture

      public BlueprintTexture(@NotNull @NotNull String name, byte[] image, int width, int height, int uvWidth, int uvHeight)
      Creates an instance of a BlueprintTexture record class.
      Parameters:
      name - the value for the name record component
      image - the value for the image record component
      width - the value for the width record component
      height - the value for the height record component
      uvWidth - the value for the uvWidth record component
      uvHeight - the value for the uvHeight record component
  • Method Details

    • isAnimatedTexture

      public boolean isAnimatedTexture()
      Checks this texture is animated
      Returns:
      whether to animate
    • canBeRendered

      public boolean canBeRendered()
      Checks this textures can be rendered.
      Returns:
      can be rendered.
    • toMcmeta

      @NotNull public @NotNull com.google.gson.JsonObject toMcmeta()
      Generates mcmeta of this image
      Returns:
      mcmeta
    • packName

      @NotNull public @NotNull String packName(@NotNull @NotNull String parent)
      Gets pack name
      Parameters:
      parent - parent
      Returns:
      pack name
    • packName

      @NotNull public @NotNull String packName(@NotNull @NotNull PackObfuscator obfuscator, @NotNull @NotNull String parent)
      Creates pack name
      Parameters:
      obfuscator - obfuscator
      parent - parent
      Returns:
      pack name
    • packNamespace

      @NotNull public @NotNull String packNamespace(@NotNull @NotNull PackObfuscator obfuscator, @NotNull @NotNull String parentName)
      Creates pack namespace
      Parameters:
      obfuscator - obfuscator
      parentName - parent name
      Returns:
      texture namespace
    • hasUVSize

      public boolean hasUVSize()
      Checks this textures has UV size
      Returns:
      has UV size
    • resolution

      @NotNull public @NotNull ModelResolution resolution(@NotNull @NotNull ModelResolution resolution)
      Gets model resolution
      Parameters:
      resolution - parent resolution
      Returns:
      resolution
    • 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
    • image

      public byte[] image()
      Returns the value of the image record component.
      Returns:
      the value of the image record component
    • width

      public int width()
      Returns the value of the width record component.
      Returns:
      the value of the width record component
    • height

      public int height()
      Returns the value of the height record component.
      Returns:
      the value of the height record component
    • uvWidth

      public int uvWidth()
      Returns the value of the uvWidth record component.
      Returns:
      the value of the uvWidth record component
    • uvHeight

      public int uvHeight()
      Returns the value of the uvHeight record component.
      Returns:
      the value of the uvHeight record component