From c71742a996473d11582256133d935448f417099f Mon Sep 17 00:00:00 2001 From: Luck Date: Sun, 5 Apr 2020 16:25:33 +0100 Subject: [PATCH] Use slightly less spammy logging when user data isn't loaded in Bungee permission check handling --- .../listeners/BungeePermissionCheckListener.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bungee/src/main/java/me/lucko/luckperms/bungee/listeners/BungeePermissionCheckListener.java b/bungee/src/main/java/me/lucko/luckperms/bungee/listeners/BungeePermissionCheckListener.java index 4f4ebe586..6c2867ec4 100644 --- a/bungee/src/main/java/me/lucko/luckperms/bungee/listeners/BungeePermissionCheckListener.java +++ b/bungee/src/main/java/me/lucko/luckperms/bungee/listeners/BungeePermissionCheckListener.java @@ -62,8 +62,12 @@ public class BungeePermissionCheckListener implements Listener { User user = this.plugin.getUserManager().getIfLoaded(player.getUniqueId()); if (user == null) { + this.plugin.getLogger().warn("A permission check was made for player " + player.getName() + " - " + player.getUniqueId() + ", " + + "but LuckPerms does not have any permissions data loaded for them. Perhaps their UUID has been altered since login?"); + new Exception().printStackTrace(); + e.setHasPermission(false); - throw new IllegalStateException("No permissions data present for player: " + player.getName() + " - " + player.getUniqueId()); + return; } QueryOptions queryOptions = this.plugin.getContextManager().getQueryOptions(player); @@ -88,8 +92,12 @@ public class BungeePermissionCheckListener implements Listener { User user = this.plugin.getUserManager().getIfLoaded(player.getUniqueId()); if (user == null) { + this.plugin.getLogger().warn("A permission check was made for player " + player.getName() + " - " + player.getUniqueId() + ", " + + "but LuckPerms does not have any permissions data loaded for them. Perhaps their UUID has been altered since login?"); + new Exception().printStackTrace(); + e.setResult(Tristate.UNDEFINED); - throw new IllegalStateException("No permissions data present for player: " + player.getName() + " - " + player.getUniqueId()); + return; } QueryOptions queryOptions = this.plugin.getContextManager().getQueryOptions(player);