From 4de8165c954045275a1af8ba6aa74c22eb609522 Mon Sep 17 00:00:00 2001 From: Luck Date: Mon, 10 Apr 2017 18:17:09 +0100 Subject: [PATCH] fix issue with /reloading and permission registration --- .../java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java index bff6775c..29a2eab7 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/LPBukkitPlugin.java @@ -301,7 +301,12 @@ public class LPBukkitPlugin extends JavaPlugin implements LuckPermsPlugin { scheduler.doAsyncRepeating(new CacheHousekeepingTask(this), 2400L); // register permissions - registerPermissions(getConfiguration().get(ConfigKeys.COMMANDS_ALLOW_OP) ? PermissionDefault.OP : PermissionDefault.FALSE); + try { + registerPermissions(getConfiguration().get(ConfigKeys.COMMANDS_ALLOW_OP) ? PermissionDefault.OP : PermissionDefault.FALSE); + } catch (Exception e) { + // this throws an exception if the plugin is /reloaded, grr + } + if (!getConfiguration().get(ConfigKeys.OPS_ENABLED)) { scheduler.doSync(() -> getServer().getOperators().forEach(o -> o.setOp(false))); }