Class TextureDownloader

java.lang.Object
foundry.veil.api.client.util.TextureDownloader

public final class TextureDownloader extends Object
Properly downloads textures from OpenGL and writes them to a file asynchronously.
  • Method Details

    • save

      public static CompletableFuture<?> save(String name, Path outputFolder, int texture, boolean flip)
      Writes the specified texture to file with the specified name. If the texture specifies mipmap levels, then the file name will be name-#.png.
      Parameters:
      name - The name of the file to save to
      outputFolder - The folder to place the file in
      texture - The id of the texture to download
      flip - Whether to flip the image on write
      Returns:
      A future for when all texture levels have been downloaded and saved
    • save

      public static CompletableFuture<?> save(String name, Path outputFolder, net.minecraft.client.renderer.texture.AbstractTexture texture, boolean flip)
      Writes the specified texture to file with the specified name. If the texture specifies mipmap levels, then the file name will be name-#.png.
      Parameters:
      name - The name of the file to save to
      outputFolder - The folder to place the file in
      texture - The texture object to download
      flip - Whether to flip the image on write
      Returns:
      A future for when all texture levels have been downloaded and saved
    • save

      public static CompletableFuture<?> save(String name, Path outputFolder, net.minecraft.resources.ResourceLocation texture, boolean flip)
      Writes the specified texture to file with the specified name. If the texture specifies mipmap levels, then the file name will be name-#.png. The missing texture will be written if there is no texture with that id.
      Parameters:
      name - The name of the file to save to
      outputFolder - The folder to place the file in
      texture - The id of the registered texture object
      flip - Whether to flip the image on write
      Returns:
      A future for when all texture levels have been downloaded and saved