mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-12 21:34:35 +01:00
Create data folder if it doesnt exist when starting the server
This commit is contained in:
@@ -37,6 +37,8 @@ public class ResourceLoader {
|
|||||||
// Make sure we don't load more than once
|
// Make sure we don't load more than once
|
||||||
if (loaded) return;
|
if (loaded) return;
|
||||||
|
|
||||||
|
// Create data folder if it doesnt exist when starting the server
|
||||||
|
checkDataFolder();
|
||||||
// Start loading resources
|
// Start loading resources
|
||||||
loadResources();
|
loadResources();
|
||||||
// Load floor infos after resources
|
// Load floor infos after resources
|
||||||
@@ -54,6 +56,13 @@ public class ResourceLoader {
|
|||||||
loaded = true;
|
loaded = true;
|
||||||
LunarCore.getLogger().info("Resource loading complete");
|
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<Class<?>> getResourceDefClasses() {
|
private static List<Class<?>> getResourceDefClasses() {
|
||||||
Reflections reflections = new Reflections(ResourceLoader.class.getPackage().getName());
|
Reflections reflections = new Reflections(ResourceLoader.class.getPackage().getName());
|
||||||
|
|||||||
Reference in New Issue
Block a user