mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-16 14:33:09 +01:00
Allow Reloading of Custom Permissions
https://github.com/PaperMC/Paper/issues/49
This commit is contained in:
parent
8a67ae1780
commit
acfd9a39a0
1 changed files with 18 additions and 0 deletions
|
@ -2818,5 +2818,23 @@ public final class CraftServer implements Server {
|
|||
}
|
||||
return this.adventure$audiences;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reloadPermissions() {
|
||||
pluginManager.clearPermissions();
|
||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().misc.loadPermissionsYmlBeforePlugins) loadCustomPermissions();
|
||||
for (Plugin plugin : pluginManager.getPlugins()) {
|
||||
for (Permission perm : plugin.getDescription().getPermissions()) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!io.papermc.paper.configuration.GlobalConfiguration.get().misc.loadPermissionsYmlBeforePlugins) loadCustomPermissions();
|
||||
DefaultPermissions.registerCorePermissions();
|
||||
CraftDefaultPermissions.registerCorePermissions();
|
||||
}
|
||||
// Paper end
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue