From 9b92143501b783a0966558d529ab8c94fee1f4ca Mon Sep 17 00:00:00 2001 From: Luck Date: Sat, 22 Oct 2016 00:07:30 +0100 Subject: [PATCH] prevent logins until the plugin has started --- .../main/java/me/lucko/luckperms/bukkit/BukkitListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitListener.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitListener.java index 21f9e5ba..58ce0c11 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitListener.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitListener.java @@ -48,7 +48,7 @@ class BukkitListener extends AbstractListener implements Listener { @EventHandler(priority = EventPriority.LOWEST) public void onPlayerPreLogin(AsyncPlayerPreLoginEvent e) { - if (!plugin.getDatastore().isAcceptingLogins()) { + if (!plugin.isStarted() || !plugin.getDatastore().isAcceptingLogins()) { // The datastore is disabled, prevent players from joining the server e.disallow(AsyncPlayerPreLoginEvent.Result.KICK_OTHER, Message.LOADING_ERROR.toString()); @@ -61,7 +61,7 @@ class BukkitListener extends AbstractListener implements Listener { @EventHandler(priority = EventPriority.MONITOR) public void onPlayerPreLoginMonitor(AsyncPlayerPreLoginEvent e) { - if (plugin.getDatastore().isAcceptingLogins() && e.getLoginResult() != AsyncPlayerPreLoginEvent.Result.ALLOWED) { + if (plugin.isStarted() && plugin.getDatastore().isAcceptingLogins() && e.getLoginResult() != AsyncPlayerPreLoginEvent.Result.ALLOWED) { // Login event was cancelled by another plugin onLeave(e.getUniqueId());