fix(i18n): fix npe on local load

This commit is contained in:
aroooo 2022-10-26 19:51:50 +02:00
parent 1e23c64144
commit 023cabd4a3

View file

@ -41,10 +41,6 @@ public class NickoBukkit extends JavaPlugin {
if (getServer().getPluginManager().isPluginEnabled(this)) { if (getServer().getPluginManager().isPluginEnabled(this)) {
mojangAPI = new MojangAPI(); mojangAPI = new MojangAPI();
getLogger().info("Loading locale...");
Locale.setDefault(Locale.ENGLISH);
i18N = new I18N(this);
final PluginCommand command = getCommand("nicko"); final PluginCommand command = getCommand("nicko");
if (command != null) { if (command != null) {
command.setExecutor(new NickoCommand()); command.setExecutor(new NickoCommand());
@ -58,8 +54,13 @@ public class NickoBukkit extends JavaPlugin {
saveDefaultConfig(); saveDefaultConfig();
nickoConfiguration = new NickoConfiguration(this); nickoConfiguration = new NickoConfiguration(this);
getLogger().info("Loading locale...");
Locale.setDefault(Locale.ENGLISH);
i18N = new I18N(this);
getLogger().info("Loading persistence..."); getLogger().info("Loading persistence...");
dataStore = new PlayerDataStore(this); dataStore = new PlayerDataStore(this);
System.out.println(dataStore.getStorage().isError());
if (!dataStore.getStorage().getProvider().init()) { if (!dataStore.getStorage().getProvider().init()) {
dataStore.getStorage().setError(true); dataStore.getStorage().setError(true);