mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-25 12:32:53 +08:00
Fix filenames
issue
This commit is contained in:
parent
aa43943025
commit
74cbad261d
@ -6,11 +6,11 @@ import emu.grasscutter.tools.Tools;
|
||||
import emu.grasscutter.utils.FileUtils;
|
||||
import emu.grasscutter.utils.Utils;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.file.FileSystems;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static emu.grasscutter.Configuration.DATA;
|
||||
|
||||
@ -18,10 +18,11 @@ public class DataLoader {
|
||||
|
||||
/**
|
||||
* Load a data file by its name. If the file isn't found within the /data directory then it will fallback to the default within the jar resources
|
||||
* @see #load(String, boolean)
|
||||
*
|
||||
* @param resourcePath The path to the data file to be loaded.
|
||||
* @return InputStream of the data file.
|
||||
* @throws FileNotFoundException
|
||||
* @see #load(String, boolean)
|
||||
*/
|
||||
public static InputStream load(String resourcePath) throws FileNotFoundException {
|
||||
return load(resourcePath, true);
|
||||
@ -29,6 +30,7 @@ public class DataLoader {
|
||||
|
||||
/**
|
||||
* Load a data file by its name.
|
||||
*
|
||||
* @param resourcePath The path to the data file to be loaded.
|
||||
* @param useFallback If the file does not exist in the /data directory, should it use the default file in the jar?
|
||||
* @return InputStream of the data file.
|
||||
@ -52,7 +54,7 @@ public class DataLoader {
|
||||
List<Path> filenames = FileUtils.getPathsFromResource("/defaults/data/");
|
||||
|
||||
if (filenames == null) {
|
||||
Grasscutter.getLogger().error("We were unable to locate your default data files.");
|
||||
Grasscutter.getLogger().error("We were unable to locate your default data files."); return;
|
||||
}
|
||||
|
||||
for (Path file : filenames) {
|
||||
|
Loading…
Reference in New Issue
Block a user