implement getCachePath (#2121)

* implement getCachePath

for further use like grids cache.

* Update src/main/java/emu/grasscutter/utils/FileUtils.java

---------

Co-authored-by: Magix <27646710+KingRainbow44@users.noreply.github.com>
This commit is contained in:
dragon
2023-04-19 03:19:29 +08:00
committed by GitHub
Unverified
parent 6989d49080
commit 0dd41f9350
3 changed files with 12 additions and 10 deletions
@@ -21,6 +21,7 @@ public final class FileUtils {
private static final Path DATA_USER_PATH = Path.of(Grasscutter.config.folderStructure.data);
private static final Path PACKETS_PATH = Path.of(Grasscutter.config.folderStructure.packets);
private static final Path PLUGINS_PATH = Path.of(Grasscutter.config.folderStructure.plugins);
private static final Path CACHE_PATH = Path.of(Grasscutter.config.folderStructure.cache);
private static final Path RESOURCES_PATH;
private static final Path SCRIPTS_PATH;
private static final String[] TSJ_JSON_TSV = {"tsj", "json", "tsv"};
@@ -138,6 +139,10 @@ public final class FileUtils {
return DATA_USER_PATH.resolve(path);
}
public static Path getCachePath(String path) {
return CACHE_PATH.resolve(path);
}
public static Path getPacketPath(String path) {
return PACKETS_PATH.resolve(path);
}