From 7444fb68dc4301c9ebae74fd29c1379cd4988fe3 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Wed, 1 Jan 2025 22:15:13 -0800 Subject: [PATCH] Create directories --- .../de/hysky/skyblocker/utils/profile/ProfiledData.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/de/hysky/skyblocker/utils/profile/ProfiledData.java b/src/main/java/de/hysky/skyblocker/utils/profile/ProfiledData.java index 4b05c77881..4b1240efd2 100644 --- a/src/main/java/de/hysky/skyblocker/utils/profile/ProfiledData.java +++ b/src/main/java/de/hysky/skyblocker/utils/profile/ProfiledData.java @@ -69,6 +69,12 @@ public CompletableFuture load() { } public void save() { + try { + Files.createDirectories(file.getParent()); + } catch (Exception e) { + LOGGER.error("[Skyblocker Profiled Data] Failed to create directories for file: {}", file, e); + } + try (BufferedWriter writer = Files.newBufferedWriter(file)) { SkyblockerMod.GSON.toJson(codec.encodeStart(compressed ? JsonOps.COMPRESSED : JsonOps.INSTANCE, data).getOrThrow(), writer); } catch (Exception e) {