mirror of
https://github.com/Anime-Game-Servers/AGSLunarCore.git
synced 2024-11-23 12:29:53 +00:00
Create data folder if it doesnt exist when starting the server
This commit is contained in:
parent
a6b656bdd2
commit
418254bfbc
@ -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<Class<?>> getResourceDefClasses() {
|
||||
Reflections reflections = new Reflections(ResourceLoader.class.getPackage().getName());
|
||||
|
Loading…
Reference in New Issue
Block a user