mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-18 18:05:05 +01:00
Fix freeze on startup (#2368)
* DON'T load resources in static init!!! * Update src/main/java/emu/grasscutter/Grasscutter.java Co-authored-by: Magix <27646710+KingRainbow44@users.noreply.github.com> * Update src/main/java/emu/grasscutter/tools/Tools.java Co-authored-by: Magix <27646710+KingRainbow44@users.noreply.github.com> --------- Co-authored-by: Magix <27646710+KingRainbow44@users.noreply.github.com>
This commit is contained in:
@@ -114,8 +114,6 @@ public class DataLoader {
|
||||
} catch (Exception e) {
|
||||
Grasscutter.getLogger().error("An error occurred while trying to check the data folder.", e);
|
||||
}
|
||||
|
||||
generateGachaMappings();
|
||||
}
|
||||
|
||||
private static void checkAndCopyData(String name) {
|
||||
@@ -131,16 +129,4 @@ public class DataLoader {
|
||||
FileUtils.copyResource("/defaults/data/" + name, filePath.toString());
|
||||
}
|
||||
}
|
||||
|
||||
private static void generateGachaMappings() {
|
||||
var path = GachaHandler.getGachaMappingsPath();
|
||||
if (!Files.exists(path)) {
|
||||
try {
|
||||
Grasscutter.getLogger().debug("Creating default '" + path + "' data");
|
||||
Tools.createGachaMappings(path);
|
||||
} catch (Exception exception) {
|
||||
Grasscutter.getLogger().warn("Failed to create gacha mappings. \n" + exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user