Record Class BlueprintTexture
java.lang.Object
java.lang.Record
kr.toxicity.model.api.data.blueprint.BlueprintTexture
- Record Components:
name- texture nameimage- imagewidth- original widthheight- original heightuvWidth- uv widthuvHeight- 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 Summary
ConstructorsConstructorDescriptionBlueprintTexture(@NotNull String name, byte[] image, int width, int height, int uvWidth, int uvHeight) Creates an instance of aBlueprintTexturerecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks this textures can be rendered.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanChecks this textures has UV sizeintheight()Returns the value of theheightrecord component.byte[]image()Returns the value of theimagerecord component.booleanChecks this texture is animated@NotNull Stringname()Returns the value of thenamerecord component.@NotNull StringGets pack name@NotNull StringpackName(@NotNull PackObfuscator obfuscator, @NotNull String parent) Creates pack name@NotNull StringpackNamespace(@NotNull PackObfuscator obfuscator, @NotNull String parentName) Creates pack namespace@NotNull ModelResolutionresolution(@NotNull ModelResolution resolution) Gets model resolution@NotNull com.google.gson.JsonObjecttoMcmeta()Generates mcmeta of this imagefinal 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) 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 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
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- obfuscatorparent- parent- Returns:
- pack name
-
packNamespace
@NotNull public @NotNull String packNamespace(@NotNull @NotNull PackObfuscator obfuscator, @NotNull @NotNull String parentName) Creates pack namespace- Parameters:
obfuscator- obfuscatorparentName- parent name- Returns:
- texture namespace
-
hasUVSize
public boolean hasUVSize()Checks this textures has UV size- Returns:
- has UV size
-
resolution
Gets model resolution- Parameters:
resolution- parent resolution- Returns:
- resolution
-
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
-