perf: delay initialisation

This commit is contained in:
aroooo 2022-10-23 18:43:20 +02:00
parent 3185886ead
commit 6331603594

View file

@ -28,8 +28,6 @@ public class NickoBukkit extends JavaPlugin {
public void onEnable() { public void onEnable() {
plugin = this; plugin = this;
mojangAPI = new MojangAPI(); mojangAPI = new MojangAPI();
nickoConfiguration = new NickoConfiguration(this);
dataStore = new PlayerDataStore(this);
getLogger().info("Loading internals..."); getLogger().info("Loading internals...");
if (getInternals() == null) { if (getInternals() == null) {
@ -50,8 +48,10 @@ public class NickoBukkit extends JavaPlugin {
getLogger().info("Loading configuration..."); getLogger().info("Loading configuration...");
saveDefaultConfig(); saveDefaultConfig();
nickoConfiguration = new NickoConfiguration(this);
getLogger().info("Loading persistence..."); getLogger().info("Loading persistence...");
dataStore = new PlayerDataStore(this);
if (!dataStore.getStorage().getProvider().init()) { if (!dataStore.getStorage().getProvider().init()) {
dataStore.getStorage().setError(true); dataStore.getStorage().setError(true);