diff --git a/src/main/java/emu/lunarcore/data/ResourceLoader.java b/src/main/java/emu/lunarcore/data/ResourceLoader.java index 3c7af4d..c4f1554 100644 --- a/src/main/java/emu/lunarcore/data/ResourceLoader.java +++ b/src/main/java/emu/lunarcore/data/ResourceLoader.java @@ -37,6 +37,8 @@ public class ResourceLoader { // Make sure we don't load more than once if (loaded) return; + // Create data folder if it doesnt exist when starting the server + checkDataFolder(); // Start loading resources loadResources(); // Load floor infos after resources @@ -54,6 +56,13 @@ public class ResourceLoader { loaded = true; LunarCore.getLogger().info("Resource loading complete"); } + + private static void checkDataFolder() { + File dir = new File(LunarCore.getConfig().getDataDir()); + if (!dir.exists()) { + dir.mkdir(); + } + } private static List> getResourceDefClasses() { Reflections reflections = new Reflections(ResourceLoader.class.getPackage().getName());