Class UVModel

java.lang.Object
kr.toxicity.library.dynamicuv.UVModel

public final class UVModel extends Object
Represents a UV model.
  • Constructor Details

    • UVModel

      public UVModel(@NotNull @NotNull UVNamespace namespace, @NotNull @NotNull String modelName)
      Creates a new UV model.
      Parameters:
      namespace - the namespace of the model
      modelName - the name of the model
  • Method Details

    • addElement

      @NotNull public @NotNull UVModel addElement(@NotNull @NotNull UVElement element)
      Adds an element to the model.
      Parameters:
      element - the element to add
      Returns:
      the model
    • itemModelNamespace

      @NotNull public @NotNull String itemModelNamespace()
      Gets the item model namespace.
      Returns:
      the item model namespace
    • modelName

      @NotNull public @NotNull String modelName()
      Gets the model name.
      Returns:
      the model name
    • packName

      @NotNull public @NotNull String packName()
      Gets the pack name.
      Returns:
      the pack name
    • packName

      public void packName(@Nullable @Nullable String packName)
      Sets the pack name.
      Parameters:
      packName - the pack name
    • asJson

      @NotNull public @NotNull List<UVByteBuilder> asJson()
      Converts the model to a list of UVByteBuilders as JSON.
      Returns:
      the list of UVByteBuilders
    • asJson

      @NotNull public @NotNull List<UVByteBuilder> asJson(@NotNull @NotNull UVTextureName textureName)
      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 name
      indexFunction - the index function
      Returns:
      the list of UVByteBuilders
    • asJson

      @NotNull public @NotNull List<UVByteBuilder> asJson(@NotNull @NotNull UVLoadContext context)
      Converts the model to a list of UVByteBuilders as JSON.
      Parameters:
      context - the load context
      Returns:
      the list of UVByteBuilders
    • write

      @NotNull public @NotNull UVModelData write(@NotNull @NotNull BufferedImage image)
      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 to
      consumer - the consumer to configure the builder
      Returns:
      the UVModelData object