From 2730aa0f61cfe1ff6533d9c8098c29d758d8fc68 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sun, 3 Nov 2024 18:42:42 +0100 Subject: [PATCH] Add forced early engine init stage check --- .../de/staropensource/engine/base/utility/FileAccess.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/base/src/main/java/de/staropensource/engine/base/utility/FileAccess.java b/base/src/main/java/de/staropensource/engine/base/utility/FileAccess.java index 3840acd0..f19ceeae 100644 --- a/base/src/main/java/de/staropensource/engine/base/utility/FileAccess.java +++ b/base/src/main/java/de/staropensource/engine/base/utility/FileAccess.java @@ -176,11 +176,13 @@ public final class FileAccess { /** * Initializes all uninitialized static * {@link FileAccess} instances. + *

+ * Only works during early engine startup. * * @since v1-alpha8 */ public static void initializeInstances() throws IOException { - if (cacheDirectory == null) { + if (Engine.getInstance().getState() == EngineState.EARLY_STARTUP) { String temp = System.getProperty("os.name").toLowerCase(Locale.ROOT); if (temp.contains("nix") || temp.contains("nux") || temp.contains("aix") || temp.contains("bsd")) @@ -197,6 +199,7 @@ public final class FileAccess { } /** * Deletes all files scheduled for deletion. + *

* Only works during engine shutdown. * * @since v1-alpha8