Package kr.toxicity.library.dynamicuv
Class UVModel
java.lang.Object
kr.toxicity.library.dynamicuv.UVModel
Represents a UV model.
-
Constructor Summary
ConstructorsConstructorDescriptionUVModel(@NotNull UVNamespace namespace, @NotNull String modelName) Creates a new UV model. -
Method Summary
Modifier and TypeMethodDescription@NotNull UVModeladdElement(@NotNull UVElement element) Adds an element to the model.@NotNull List<UVByteBuilder> asJson()Converts the model to a list of UVByteBuilders as JSON.@NotNull List<UVByteBuilder> asJson(@NotNull UVLoadContext context) Converts the model to a list of UVByteBuilders as JSON.@NotNull List<UVByteBuilder> asJson(@NotNull UVTextureName textureName) Converts the model to a list of UVByteBuilders as JSON.@NotNull List<UVByteBuilder> asJson(@NotNull UVTextureName textureName, @NotNull UVIndexFunction indexFunction) Converts the model to a list of UVByteBuilders as JSON.@NotNull StringGets the item model namespace.@NotNull StringGets the model name.@NotNull StringpackName()Gets the pack name.voidSets the pack name.@NotNull UVModelDatawrite(@NotNull BufferedImage image) Writes the model to a UVModelData object.@NotNull UVModelDatawrite(@NotNull BufferedImage image, @NotNull Consumer<UVModelData.Builder> consumer) Writes the model to a UVModelData object.
-
Constructor Details
-
UVModel
Creates a new UV model.- Parameters:
namespace- the namespace of the modelmodelName- the name of the model
-
-
Method Details
-
addElement
Adds an element to the model.- Parameters:
element- the element to add- Returns:
- the model
-
itemModelNamespace
Gets the item model namespace.- Returns:
- the item model namespace
-
modelName
Gets the model name.- Returns:
- the model name
-
packName
Gets the pack name.- Returns:
- the pack name
-
packName
Sets the pack name.- Parameters:
packName- the pack name
-
asJson
Converts the model to a list of UVByteBuilders as JSON.- Returns:
- the list of UVByteBuilders
-
asJson
Converts the model to a list of UVByteBuilders as JSON.- Parameters:
textureName- the texture name- Returns:
- the list of UVByteBuilders
-
asJson
@NotNull public @NotNull List<UVByteBuilder> asJson(@NotNull @NotNull UVTextureName textureName, @NotNull @NotNull UVIndexFunction indexFunction) Converts the model to a list of UVByteBuilders as JSON.- Parameters:
textureName- the texture nameindexFunction- the index function- Returns:
- the list of UVByteBuilders
-
asJson
Converts the model to a list of UVByteBuilders as JSON.- Parameters:
context- the load context- Returns:
- the list of UVByteBuilders
-
write
Writes the model to a UVModelData object.- Parameters:
image- the image to write to- Returns:
- the UVModelData object
-
write
@NotNull public @NotNull UVModelData write(@NotNull @NotNull BufferedImage image, @NotNull @NotNull Consumer<UVModelData.Builder> consumer) Writes the model to a UVModelData object.- Parameters:
image- the image to write toconsumer- the consumer to configure the builder- Returns:
- the UVModelData object
-