Also Reload Plugin Defined Permissions
Closes https://github.com/PaperMC/Paper/issues/210
This commit is contained in:
@@ -19,6 +19,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ public void reloadPermissions() {
|
||||
+ ((SimplePluginManager) pluginManager).clearPermissions();
|
||||
+ loadCustomPermissions();
|
||||
+ for (Plugin plugin : pluginManager.getPlugins()) {
|
||||
+ plugin.getDescription().getPermissions().forEach((perm) -> {
|
||||
+ try {
|
||||
+ pluginManager.addPermission(perm);
|
||||
+ } catch (IllegalArgumentException ex) {
|
||||
+ getLogger().log(Level.WARNING, "Plugin " + plugin.getDescription().getFullName() + " tried to register permission '" + perm.getName() + "' but it's already registered", ex);
|
||||
+ }
|
||||
+ });
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user