Record Class BlueprintTexture

java.lang.Object
java.lang.Record
kr.toxicity.model.api.data.blueprint.BlueprintTexture
Record Components:
name - the internal name of the texture
image - the binary content of the texture image
width - the original width of the texture in pixels
height - the original height of the texture in pixels
uvWidth - the UV width of the texture, if specified
uvHeight - the UV height of the texture, if specified
canBeRendered - whether this texture should be included in the resource pack
frameTime - the frame time of the texture
frameInterpolate - the interpolation flag of the texture

public record BlueprintTexture(@NotNull String name, byte[] image, int width, int height, int uvWidth, int uvHeight, boolean canBeRendered, int frameTime, boolean frameInterpolate) extends Record
Represents a processed texture in a model blueprint.

This record holds the texture's name, binary image data, dimensions, and rendering properties.

Since:
1.15.2
  • Constructor Summary

    Constructors
    Constructor
    Description
    BlueprintTexture(@NotNull String name, byte[] image, int width, int height, int uvWidth, int uvHeight, boolean canBeRendered, int frameTime, boolean frameInterpolate)
    Creates an instance of a BlueprintTexture record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the canBeRendered record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    boolean
    Returns the value of the frameInterpolate record component.
    int
    Returns the value of the frameTime record component.
    final int
    Returns a hash code value for this object.
    boolean
    Checks if this texture has a specific UV size defined.
    int
    Returns the value of the height record component.
    byte[]
    Returns the value of the image record component.
    boolean
    Checks if this texture is an animated texture (a texture atlas for animation).
    @NotNull String
    Returns the value of the name record component.
    @NotNull String
    packName(@NotNull PackObfuscator obfuscator)
    Generates the pack-compliant file name for this texture.
    @NotNull String
    packNamespace(@NotNull PackObfuscator obfuscator)
    Generates the full resource pack namespace path for this texture.
    resolution(@NotNull ModelResolution resolution)
    Returns the effective resolution for this texture's UV mapping.
    @NotNull com.google.gson.JsonObject
    Generates the .mcmeta file content for this texture if it is animated.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the uvHeight record component.
    int
    Returns the value of the uvWidth record component.
    int
    Returns the value of the width record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • BlueprintTexture

      public BlueprintTexture(@NotNull @NotNull String name, byte[] image, int width, int height, int uvWidth, int uvHeight, boolean canBeRendered, int frameTime, boolean frameInterpolate)
      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
      canBeRendered - the value for the canBeRendered record component
      frameTime - the value for the frameTime record component
      frameInterpolate - the value for the frameInterpolate record component
  • Method Details

    • isAnimatedTexture

      public boolean isAnimatedTexture()
      Checks if this texture is an animated texture (a texture atlas for animation).
      Returns:
      true if it is an animated texture, false otherwise
      Since:
      1.15.2
    • toMcmeta

      @NotNull public @NotNull com.google.gson.JsonObject toMcmeta()
      Generates the .mcmeta file content for this texture if it is animated.
      Returns:
      the JSON object for the .mcmeta file
      Since:
      1.15.2
    • packName

      @NotNull public @NotNull String packName(@NotNull @NotNull PackObfuscator obfuscator)
      Generates the pack-compliant file name for this texture.
      Parameters:
      obfuscator - the obfuscator to use for the name
      Returns:
      the obfuscated file name
      Since:
      1.15.2
    • packNamespace

      @NotNull public @NotNull String packNamespace(@NotNull @NotNull PackObfuscator obfuscator)
      Generates the full resource pack namespace path for this texture.
      Parameters:
      obfuscator - the obfuscator to use for the name
      Returns:
      the texture's namespace path
      Since:
      1.15.2
    • hasUVSize

      public boolean hasUVSize()
      Checks if this texture has a specific UV size defined.
      Returns:
      true if UV width and height are specified, false otherwise
      Since:
      1.15.2
    • resolution

      @NotNull public @NotNull ModelResolution resolution(@NotNull @NotNull ModelResolution resolution)
      Returns the effective resolution for this texture's UV mapping.
      Parameters:
      resolution - the parent model's resolution
      Returns:
      the UV resolution, or the parent resolution if not specified
      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.
    • 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
    • canBeRendered

      public boolean canBeRendered()
      Returns the value of the canBeRendered record component.
      Returns:
      the value of the canBeRendered record component
    • frameTime

      public int frameTime()
      Returns the value of the frameTime record component.
      Returns:
      the value of the frameTime record component
    • frameInterpolate

      public boolean frameInterpolate()
      Returns the value of the frameInterpolate record component.
      Returns:
      the value of the frameInterpolate record component