From 198e8f9ea2add870bfdb3754dca26a71299abf6f Mon Sep 17 00:00:00 2001 From: Smart123s <28480228+Smart123s@users.noreply.github.com> Date: Sun, 15 Aug 2021 17:23:47 +0200 Subject: [PATCH] Fix Floodgate without auth plugin If no auth plugin is installed, rely on StoredProfile This fixes #594 --- .../core/shared/FloodgateManagement.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/github/games647/fastlogin/core/shared/FloodgateManagement.java b/core/src/main/java/com/github/games647/fastlogin/core/shared/FloodgateManagement.java index 92cae665..3b36c3ea 100644 --- a/core/src/main/java/com/github/games647/fastlogin/core/shared/FloodgateManagement.java +++ b/core/src/main/java/com/github/games647/fastlogin/core/shared/FloodgateManagement.java @@ -73,10 +73,20 @@ public abstract class FloodgateManagement
authPlugin = core.getAuthPluginHook(); - + try { - isRegistered = authPlugin.isRegistered(username); + //maybe Bungee without auth plugin + if (authPlugin == null) { + if (profile != null) { + isRegistered = profile.isPremium(); + } else { + isRegistered = false; + } + } else { + isRegistered = authPlugin.isRegistered(username); + } } catch (Exception ex) { core.getPlugin().getLog().error( "An error has occured while checking if player {} is registered", @@ -108,7 +118,6 @@ public abstract class FloodgateManagement