Add forced early engine init stage check

This commit is contained in:
JeremyStar™ 2024-11-03 18:42:42 +01:00
parent ed1c8b9d3e
commit 2730aa0f61
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -176,11 +176,13 @@ public final class FileAccess {
/** /**
* Initializes all uninitialized static * Initializes all uninitialized static
* {@link FileAccess} instances. * {@link FileAccess} instances.
* <p>
* Only works during early engine startup.
* *
* @since v1-alpha8 * @since v1-alpha8
*/ */
public static void initializeInstances() throws IOException { 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); String temp = System.getProperty("os.name").toLowerCase(Locale.ROOT);
if (temp.contains("nix") || temp.contains("nux") || temp.contains("aix") || temp.contains("bsd")) 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. * Deletes all files scheduled for deletion.
* <p>
* Only works during engine shutdown. * Only works during engine shutdown.
* *
* @since v1-alpha8 * @since v1-alpha8