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 imagewidth- the width of the texture in pixelsheight- the height of the texture in pixelsuvWidth- the UV width of the textureuvHeight- the UV height of the textureframeTime- the frame time of the textureframeInterpolate- 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 Summary
ConstructorsConstructorDescriptionModelTexture(@NotNull String name, @NotNull String source, int width, int height, int uvWidth, int uvHeight, int frameTime, boolean frameInterpolate) Creates an instance of aModelTexturerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.booleanReturns the value of theframeInterpolaterecord component.intReturns the value of theframeTimerecord component.final inthashCode()Returns a hash code value for this object.intheight()Returns the value of theheightrecord component.@NotNull Stringname()Returns the value of thenamerecord component.@NotNull StringReturns the texture name without its file extension.@NotNull Stringsource()Returns the value of thesourcerecord component.@NotNull BlueprintTexturetoBlueprint(@NotNull ModelLoadContext context) Converts this raw texture into a processedBlueprintTexture.final StringtoString()Returns a string representation of this record class.intuvHeight()Returns the value of theuvHeightrecord component.intuvWidth()Returns the value of theuvWidthrecord component.intwidth()Returns the value of thewidthrecord component.
-
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 aModelTexturerecord class.- Parameters:
name- the value for thenamerecord componentsource- the value for thesourcerecord componentwidth- the value for thewidthrecord componentheight- the value for theheightrecord componentuvWidth- the value for theuvWidthrecord componentuvHeight- the value for theuvHeightrecord componentframeTime- the value for theframeTimerecord componentframeInterpolate- the value for theframeInterpolaterecord component
-
-
Method Details
-
toBlueprint
Converts this raw texture into a processedBlueprintTexture.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
Returns the texture name without its file extension.- Returns:
- the name without extension
- Since:
- 1.15.2
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
name
-
source
-
width
-
height
-
uvWidth
-
uvHeight
-
frameTime
-
frameInterpolate
@SerializedName("frame_interpolate") public boolean frameInterpolate()Returns the value of theframeInterpolaterecord component.- Returns:
- the value of the
frameInterpolaterecord component
-