Fix dataloader with eclipse

This commit is contained in:
Melledy
2022-05-19 00:10:02 -07:00
parent a5007a4392
commit a088ea9b6b
2 changed files with 23 additions and 13 deletions

View File

@@ -7,8 +7,10 @@ import emu.grasscutter.utils.FileUtils;
import emu.grasscutter.utils.Utils;
import java.io.*;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.util.List;
import java.util.regex.Pattern;
import static emu.grasscutter.Configuration.DATA;
@@ -46,17 +48,18 @@ public class DataLoader {
}
public static void CheckAllFiles() {
String pathSplitter = "defaults" + Pattern.quote(FileSystems.getDefault().getSeparator()) + "data" + Pattern.quote(FileSystems.getDefault().getSeparator());
try {
List<Path> filenames = FileUtils.getPathsFromResource("/defaults/data/");
for (Path file : filenames) {
String relativePath = String.valueOf(file).split("/defaults/data/")[1];
String relativePath = String.valueOf(file).split(pathSplitter)[1];
CheckAndCopyData(relativePath);
}
} catch (Exception e) {
Grasscutter.getLogger().error("An error occurred while trying to check the data folder. \n" + e);
Grasscutter.getLogger().error("An error occurred while trying to check the data folder. \n", e);
}
GenerateGachaMappings();