Record Class ModelUV
java.lang.Object
java.lang.Record
kr.toxicity.model.api.data.raw.ModelUV
- Record Components:
uv- the UV coordinates as aFloat4(u1, v1, u2, v2)rotation- the rotation of the UV map in degrees (0, 90, 180, 270)texture- the JSON element representing the texture index, can be null
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanChecks if this UV mapping has a valid texture index.introtation()Returns the value of therotationrecord component.@Nullable com.google.gson.JsonElementtexture()Returns the value of thetexturerecord component.intReturns the texture index associated with this UV mapping.@Nullable com.google.gson.JsonObjecttoJson(@NotNull BlueprintLoadContext context, int tint) Converts this UV data to a JSON object for the Minecraft model file.final StringtoString()Returns a string representation of this record class.@NotNull Float4uv()Returns the value of theuvrecord component.
-
Constructor Details
-
ModelUV
public ModelUV(@NotNull @NotNull Float4 uv, int rotation, @Nullable @Nullable com.google.gson.JsonElement texture) Creates an instance of aModelUVrecord class.
-
-
Method Details
-
hasTexture
public boolean hasTexture()Checks if this UV mapping has a valid texture index.- Returns:
- true if a texture is defined, false otherwise
- Since:
- 1.15.2
-
textureIndex
public int textureIndex()Returns the texture index associated with this UV mapping.- Returns:
- the texture index
- Throws:
NullPointerException- if no texture is defined- Since:
- 1.15.2
-
toJson
@Nullable public @Nullable com.google.gson.JsonObject toJson(@NotNull @NotNull BlueprintLoadContext context, int tint) Converts this UV data to a JSON object for the Minecraft model file.- Parameters:
context- the blueprint context, used for texture resolutiontint- the tint index to apply- Returns:
- the generated JSON object
- 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. -
uv
-
rotation
-
texture
-