Record Class BlueprintTexture
java.lang.Object
java.lang.Record
kr.toxicity.model.api.data.blueprint.BlueprintTexture
- Record Components:
name- the internal name of the textureimage- the binary content of the texture imagewidth- the original width of the texture in pixelsheight- the original height of the texture in pixelsuvWidth- the UV width of the texture, if specifieduvHeight- the UV height of the texture, if specifiedcanBeRendered- whether this texture should be included in the resource packframeTime- the frame time of the textureframeInterpolate- 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
ConstructorsConstructorDescriptionBlueprintTexture(@NotNull String name, byte[] image, int width, int height, int uvWidth, int uvHeight, boolean canBeRendered, int frameTime, boolean frameInterpolate) Creates an instance of aBlueprintTexturerecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecanBeRenderedrecord component.final 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.booleanChecks if this texture has a specific UV size defined.intheight()Returns the value of theheightrecord component.byte[]image()Returns the value of theimagerecord component.booleanChecks if this texture is an animated texture (a texture atlas for animation).@NotNull Stringname()Returns the value of thenamerecord component.@NotNull StringpackName(@NotNull PackObfuscator obfuscator) Generates the pack-compliant file name for this texture.@NotNull StringpackNamespace(@NotNull PackObfuscator obfuscator) Generates the full resource pack namespace path for this texture.@NotNull ModelResolutionresolution(@NotNull ModelResolution resolution) Returns the effective resolution for this texture's UV mapping.@NotNull com.google.gson.JsonObjecttoMcmeta()Generates the .mcmeta file content for this texture if it is animated.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
-
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 aBlueprintTexturerecord class.- Parameters:
name- the value for thenamerecord componentimage- the value for theimagerecord componentwidth- the value for thewidthrecord componentheight- the value for theheightrecord componentuvWidth- the value for theuvWidthrecord componentuvHeight- the value for theuvHeightrecord componentcanBeRendered- the value for thecanBeRenderedrecord componentframeTime- the value for theframeTimerecord componentframeInterpolate- the value for theframeInterpolaterecord 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
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
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
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
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. -
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. -
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 '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
image
public byte[] image()Returns the value of theimagerecord component.- Returns:
- the value of the
imagerecord component
-
width
public int width()Returns the value of thewidthrecord component.- Returns:
- the value of the
widthrecord component
-
height
public int height()Returns the value of theheightrecord component.- Returns:
- the value of the
heightrecord component
-
uvWidth
public int uvWidth()Returns the value of theuvWidthrecord component.- Returns:
- the value of the
uvWidthrecord component
-
uvHeight
public int uvHeight()Returns the value of theuvHeightrecord component.- Returns:
- the value of the
uvHeightrecord component
-
canBeRendered
public boolean canBeRendered()Returns the value of thecanBeRenderedrecord component.- Returns:
- the value of the
canBeRenderedrecord component
-
frameTime
public int frameTime()Returns the value of theframeTimerecord component.- Returns:
- the value of the
frameTimerecord component
-
frameInterpolate
public boolean frameInterpolate()Returns the value of theframeInterpolaterecord component.- Returns:
- the value of the
frameInterpolaterecord component
-