diff --git a/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeePlugin.java b/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeePlugin.java index 171de9ad6..33848d62f 100644 --- a/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeePlugin.java +++ b/bungee/src/main/java/me/lucko/luckperms/bungee/LPBungeePlugin.java @@ -150,7 +150,7 @@ public class LPBungeePlugin extends AbstractLuckPermsPlugin { this.contextManager.registerCalculator(playerCalculator); } - if (!disabledContexts.contains("proxy") && this.bootstrap.getProxy().getPluginManager().getPlugin("RedisBungee") != null) { + if (!disabledContexts.contains("proxy") && this.bootstrap.getProxy().getPluginManager().getPlugin("RedisBungee") != null && isRedisBungeeLoaded()) { this.contextManager.registerCalculator(new RedisBungeeCalculator()); } } @@ -199,6 +199,19 @@ public class LPBungeePlugin extends AbstractLuckPermsPlugin { return this.senderFactory.wrap(this.bootstrap.getProxy().getConsole()); } + private static boolean classExists(String className) { + try { + Class.forName(className); + return true; + } catch (ClassNotFoundException var1) { + return false; + } + } + + private static boolean isRedisBungeeLoaded() { + return classExists("com.imaginarycode.minecraft.redisbungee.RedisBungee"); + } + public BungeeSenderFactory getSenderFactory() { return this.senderFactory; }