Fix old files if they exist.

This commit is contained in:
GJ 2013-10-07 10:43:22 -04:00
parent c2f8f4d016
commit 9aaea7e44f

View File

@ -290,6 +290,20 @@ public class mcMMO extends JavaPlugin {
flatFileDirectory = mainDirectory + "flatfile" + File.separator; flatFileDirectory = mainDirectory + "flatfile" + File.separator;
usersFile = flatFileDirectory + "mcmmo.users"; usersFile = flatFileDirectory + "mcmmo.users";
modDirectory = mainDirectory + "mods" + File.separator; modDirectory = mainDirectory + "mods" + File.separator;
fixFilePaths();
}
private void fixFilePaths() {
File oldFlatfilePath = new File(mainDirectory + "FlatFileStuff" + File.separator);
File oldModPath = new File(mainDirectory + "ModConfigs" + File.separator);
if (oldFlatfilePath.exists()) {
oldFlatfilePath.renameTo(new File(flatFileDirectory));
}
if (oldModPath.exists()) {
oldModPath.renameTo(new File(modDirectory));
}
} }
private void checkForUpdates() { private void checkForUpdates() {