Skip to content

Commit

Permalink
Ensure folder exists when dumping item renders.
Browse files Browse the repository at this point in the history
  • Loading branch information
covers1624 committed Sep 22, 2024
1 parent 2df47fe commit 62734a9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/codechicken/lib/internal/ItemFileRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexSorting;
import net.covers1624.quack.image.AnimatedGifEncoder;
import net.covers1624.quack.io.IOUtils;
import net.covers1624.quack.platform.OperatingSystem;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
Expand Down Expand Up @@ -162,7 +163,7 @@ private StaticRenderTask(ItemStack stack, int resolution, Path path) {
protected boolean render() throws IOException {
try (NativeImage image = takeItemScreenshot()) {
image.flipY();
image.writeToFile(path);
image.writeToFile(IOUtils.makeParents(path));
}
return true;
}
Expand Down Expand Up @@ -228,7 +229,7 @@ private GifRenderTask(ItemStack stack, int resolution, Path path, int fps, int d

@Override
protected void serialize() throws IOException {
try (OutputStream os = Files.newOutputStream(path)) {
try (OutputStream os = Files.newOutputStream(IOUtils.makeParents(path))) {
AnimatedGifEncoder encoder = new AnimatedGifEncoder();
encoder.start(os);
encoder.setDelay((int) frameDelay);
Expand Down

0 comments on commit 62734a9

Please sign in to comment.