mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Dedicated directory for locales
This commit is contained in:
parent
0f2e1ea740
commit
1ca48051ad
@ -104,7 +104,7 @@ public final class LocaleLoader {
|
||||
throw new IllegalStateException("Failed to parse locale string '" + Config.getInstance().getLocale() + "'");
|
||||
}
|
||||
|
||||
Path localePath = Paths.get(mcMMO.getMainDirectory() + "locale_" + locale.toString() + ".properties");
|
||||
Path localePath = Paths.get(mcMMO.getLocalesDirectory() + "locale_" + locale.toString() + ".properties");
|
||||
if (Files.exists(localePath) && Files.isRegularFile(localePath)) {
|
||||
try (Reader localeReader = Files.newBufferedReader(localePath)) {
|
||||
filesystemBundle = new PropertyResourceBundle(localeReader);
|
||||
|
@ -79,6 +79,7 @@ public class mcMMO extends JavaPlugin {
|
||||
|
||||
/* File Paths */
|
||||
private static String mainDirectory;
|
||||
private static String localesDirectory;
|
||||
private static String flatFileDirectory;
|
||||
private static String usersFile;
|
||||
private static String modDirectory;
|
||||
@ -357,6 +358,10 @@ public class mcMMO extends JavaPlugin {
|
||||
return mainDirectory;
|
||||
}
|
||||
|
||||
public static String getLocalesDirectory() {
|
||||
return localesDirectory;
|
||||
}
|
||||
|
||||
public static String getFlatFileDirectory() {
|
||||
return flatFileDirectory;
|
||||
}
|
||||
@ -432,6 +437,7 @@ public class mcMMO extends JavaPlugin {
|
||||
private void setupFilePaths() {
|
||||
mcmmo = getFile();
|
||||
mainDirectory = getDataFolder().getPath() + File.separator;
|
||||
localesDirectory = mainDirectory + "locales" + File.separator;
|
||||
flatFileDirectory = mainDirectory + "flatfile" + File.separator;
|
||||
usersFile = flatFileDirectory + "mcmmo.users";
|
||||
modDirectory = mainDirectory + "mods" + File.separator;
|
||||
@ -485,6 +491,8 @@ public class mcMMO extends JavaPlugin {
|
||||
|
||||
File currentFlatfilePath = new File(flatFileDirectory);
|
||||
currentFlatfilePath.mkdirs();
|
||||
File localesDirectoryPath = new File(localesDirectory);
|
||||
localesDirectoryPath.mkdirs();
|
||||
}
|
||||
|
||||
private void loadConfigFiles() {
|
||||
|
Loading…
Reference in New Issue
Block a user