diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java index 3aadad5e..a01f2143 100644 --- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java +++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java @@ -40,23 +40,12 @@ public class FastLoginBungee extends Plugin implements PlatformPlugin session = Maps.newConcurrentMap(); private FastLoginCore core; - private Configuration config; @Override public void onEnable() { - try { - File configFile = new File(getDataFolder(), "config.yml"); - ConfigurationProvider provider = ConfigurationProvider.getProvider(YamlConfiguration.class); - Configuration defaults = provider.load(getResourceAsStream("config.yml")); - config = provider.load(configFile, defaults); - - core = new FastLoginCore<>(this); - core.load(); - if (!core.setupDatabase()) { - return; - } - } catch (IOException ioExc) { - getLogger().log(Level.SEVERE, "Error loading config. Disabling plugin...", ioExc); + core = new FastLoginCore<>(this); + core.load(); + if (!core.setupDatabase()) { return; } @@ -106,10 +95,6 @@ public class FastLoginBungee extends Plugin implements PlatformPlugin getSession() { return session; } diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/PlayerConnectionListener.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/PlayerConnectionListener.java index f8586182..50b5db3c 100644 --- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/PlayerConnectionListener.java +++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/PlayerConnectionListener.java @@ -71,7 +71,7 @@ public class PlayerConnectionListener implements Listener { //bungeecord will do this automatically so override it on disabled option InitialHandler initialHandler = (InitialHandler) connection; - if (!plugin.getConfig().getBoolean("premiumUuid")) { + if (!plugin.getCore().getConfig().get("premiumUuid", true)) { try { UUID offlineUUID = UUID.nameUUIDFromBytes(("OfflinePlayer:" + username).getBytes(Charsets.UTF_8)); @@ -85,7 +85,7 @@ public class PlayerConnectionListener implements Listener { } } - if (!plugin.getConfig().getBoolean("forwardSkin")) { + if (!plugin.getCore().getConfig().get("forwardSkin", true)) { //this is null on offline mode LoginResult loginProfile = initialHandler.getLoginProfile(); if (loginProfile != null) { diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/PluginMessageListener.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/PluginMessageListener.java index 119a8431..9845f36e 100644 --- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/PluginMessageListener.java +++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/PluginMessageListener.java @@ -59,7 +59,7 @@ public class PluginMessageListener implements Listener { String playerName = dataInput.readUTF(); boolean isPlayerSender = dataInput.readBoolean(); - if (playerName.equals(forPlayer.getName()) && plugin.getConfig().getBoolean("premium-warning") + if (playerName.equals(forPlayer.getName()) && plugin.getCore().getConfig().get("premium-warning", true) && !core.getPendingConfirms().contains(forPlayer.getUniqueId())) { String message = core.getMessage("premium-warning"); forPlayer.sendMessage(TextComponent.fromLegacyText(message));