Need different methods for mod files and regular files.

This commit is contained in:
GJ 2013-10-18 10:12:55 -04:00
parent 2042e0cdbd
commit 7f4e3fedb3

View File

@ -29,7 +29,13 @@ public abstract class ConfigLoader {
protected void loadFile() { protected void loadFile() {
if (!configFile.exists()) { if (!configFile.exists()) {
plugin.debug("Creating mcMMO " + fileName + " File..."); plugin.debug("Creating mcMMO " + fileName + " File...");
plugin.saveResource(configFile.getParentFile().getName() + File.separator + fileName, false);
try {
plugin.saveResource(fileName, false); // Normal files
}
catch (IllegalArgumentException ex) {
plugin.saveResource(configFile.getParentFile().getName() + File.separator + fileName, false); // Mod files
}
} }
else { else {
plugin.debug("Loading mcMMO " + fileName + " File..."); plugin.debug("Loading mcMMO " + fileName + " File...");