Move lang updating to updateLang() in the main class

This commit is contained in:
gomeow
2013-05-27 23:59:28 -07:00
parent 559d0f7f66
commit 91979b5526
2 changed files with 12 additions and 18 deletions
@@ -250,9 +250,21 @@ public class PlayerVaults extends JavaPlugin {
}
}
YamlConfiguration conf = YamlConfiguration.loadConfiguration(lang);
for(Lang item:Lang.values()) {
if (conf.getString(item.getPath()) == null) {
conf.set(item.getPath(), item.getDefault());
}
}
Lang.setFile(conf);
PlayerVaults.LANG = conf;
PlayerVaults.LANG_FILE = lang;
try {
conf.save(getLangFile());
} catch(IOException e) {
log.log(Level.WARNING, "PlayerVaults: Failed to save lang.yml.");
log.log(Level.WARNING, "PlayerVaults: Report this stack trace to drtshock and gomeow.");
e.printStackTrace();
}
return conf;
}