From 5a63464cce7d5c21cccc6d449dcee51d7569a01a Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 27 May 2020 11:22:46 +0200 Subject: [PATCH] fix: handle object creation correctly in JavaPlugin --- .../main/java/de/cliffbreak/varo/Varo.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/varo/src/main/java/de/cliffbreak/varo/Varo.java b/varo/src/main/java/de/cliffbreak/varo/Varo.java index cb80ed0..61bbea5 100644 --- a/varo/src/main/java/de/cliffbreak/varo/Varo.java +++ b/varo/src/main/java/de/cliffbreak/varo/Varo.java @@ -63,18 +63,6 @@ public class Varo extends JavaPlugin { this.configurationFile = new File("plugins/CliffbreakVaro", "config.yml"); this.config = YamlConfiguration.loadConfiguration(this.configurationFile); - this.npcManager = new NPCManager(this); - this.playerCache = new PlayerCache(this); - this.banUtils = new BanUtils(this); - this.varoUtils = new VaroUtils(this); - this.teamManager = new TeamManager(); - this.messageUtils = new MessageUtils(this); - this.database = new Database(); - this.gameTimeManager = new GameTimeManager(this); - this.playerUtils = new PlayerUtils(this); - this.borderManager = new BorderManager(this); - this.langUtils = new LangUtils(); - this.config.addDefault("Varo.Start", 1590393600000f); this.config.addDefault("Varo.Debug", false); this.config.addDefault("Varo.Discord.Token", "insert.token.here"); @@ -89,6 +77,18 @@ public class Varo extends JavaPlugin { this.config.options().copyDefaults(true); this.saveConfig(); + this.database = new Database(); + this.teamManager = new TeamManager(); + this.playerCache = new PlayerCache(this); + this.npcManager = new NPCManager(this); + this.banUtils = new BanUtils(this); + this.varoUtils = new VaroUtils(this); + this.messageUtils = new MessageUtils(this); + this.gameTimeManager = new GameTimeManager(this); + this.playerUtils = new PlayerUtils(this); + this.borderManager = new BorderManager(this); + this.langUtils = new LangUtils(); + this.getServer().getPluginManager().registerEvents(new PlayerLoginListener(this), this); this.getServer().getPluginManager().registerEvents(new PlayerJoinQuitListener(this), this); this.getServer().getPluginManager().registerEvents(new PlayerClientOptionsChangeListener(this), this);