Moves config loading to finisSetup() to prevent a NullPointerException

This commit is contained in:
Kristian Knarvik 2021-10-31 18:05:04 +01:00
parent d754247455
commit 01df8db0bf

View File

@ -60,19 +60,19 @@ public final class StargateConfig {
portalFolder = dataFolderPath + "/portals/";
gateFolder = dataFolderPath + "/gates/";
languageLoader = new LanguageLoader(dataFolderPath + "/lang/");
this.loadConfig();
//Enable the required channels for Bungee support
if (stargateGateConfig.enableBungee()) {
startStopBungeeListener(true);
}
}
/**
* Finish the config setup by loading languages, gates and portals, and loading economy if vault is loaded
*/
public void finishSetup() {
this.loadConfig();
//Enable the required channels for Bungee support
if (stargateGateConfig.enableBungee()) {
startStopBungeeListener(true);
}
//Set the chosen language and reload the language loader
languageLoader.setChosenLanguage(languageName);
languageLoader.reload();