Package foundry.veil.api.client.util
Class TextureDownloader
java.lang.Object
foundry.veil.api.client.util.TextureDownloader
Properly downloads textures from OpenGL and writes them to a file asynchronously.
-
Method Summary
Modifier and TypeMethodDescriptionstatic CompletableFuture
<?> Writes the specified texture to file with the specified name.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.static CompletableFuture
<?> save
(String name, Path outputFolder, net.minecraft.resources.ResourceLocation texture, boolean flip) Writes the specified texture to file with the specified name.
-
Method Details
-
save
Writes the specified texture to file with the specified name. If the texture specifies mipmap levels, then the file name will bename-#.png
.- Parameters:
name
- The name of the file to save tooutputFolder
- The folder to place the file intexture
- The id of the texture to downloadflip
- 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 bename-#.png
.- Parameters:
name
- The name of the file to save tooutputFolder
- The folder to place the file intexture
- The texture object to downloadflip
- 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 bename-#.png
. The missing texture will be written if there is no texture with that id.- Parameters:
name
- The name of the file to save tooutputFolder
- The folder to place the file intexture
- The id of the registered texture objectflip
- Whether to flip the image on write- Returns:
- A future for when all texture levels have been downloaded and saved
-