Record Class ModelTexture

java.lang.Object
java.lang.Record
kr.toxicity.model.api.data.raw.ModelTexture
Record Components:
name - the name of the texture file (e.g., "texture.png")
source - the Base64-encoded content of the texture image
width - the width of the texture in pixels
height - the height of the texture in pixels
uvWidth - the UV width of the texture
uvHeight - the UV height of the texture
frameTime - the frame time of the texture
frameInterpolate - the interpolation flag of the texture

@Internal public record ModelTexture(@NotNull String name, @NotNull String source, int width, int height, int uvWidth, int uvHeight, int frameTime, boolean frameInterpolate) extends Record
Represents a raw texture definition from a model file.

This record contains the texture's metadata and its content encoded as a Base64 string.

Since:
1.15.2
  • Constructor Details

    • ModelTexture

      public ModelTexture(@NotNull @NotNull String name, @NotNull @NotNull String source, int width, int height, int uvWidth, int uvHeight, int frameTime, boolean frameInterpolate)
      Creates an instance of a ModelTexture record class.
      Parameters:
      name - the value for the name record component
      source - the value for the source 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
      frameTime - the value for the frameTime record component
      frameInterpolate - the value for the frameInterpolate record component
  • Method Details

    • toBlueprint

      @NotNull public @NotNull BlueprintTexture toBlueprint(@NotNull @NotNull ModelLoadContext context)
      Converts this raw texture into a processed BlueprintTexture.

      This method decodes the Base64 source, generates a pack-compliant name, and determines if the texture should be included in the pack.

      Parameters:
      context - the model loading context
      Returns:
      the blueprint texture
      Since:
      1.15.2
    • nameWithoutExtension

      @NotNull public @NotNull String nameWithoutExtension()
      Returns the texture name without its file extension.
      Returns:
      the name without extension
      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
    • source

      @NotNull public @NotNull String source()
      Returns the value of the source record component.
      Returns:
      the value of the source 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

      @SerializedName("uv_width") public int uvWidth()
      Returns the value of the uvWidth record component.
      Returns:
      the value of the uvWidth record component
    • uvHeight

      @SerializedName("uv_height") public int uvHeight()
      Returns the value of the uvHeight record component.
      Returns:
      the value of the uvHeight record component
    • frameTime

      @SerializedName("frame_time") public int frameTime()
      Returns the value of the frameTime record component.
      Returns:
      the value of the frameTime record component
    • frameInterpolate

      @SerializedName("frame_interpolate") public boolean frameInterpolate()
      Returns the value of the frameInterpolate record component.
      Returns:
      the value of the frameInterpolate record component