fix issue with /reloading and permission registration

This commit is contained in:
Luck 2017-04-10 18:17:09 +01:00
parent 242672f49d
commit 4de8165c95
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -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)));
}