mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
Merge pull request #212 from willies952002/feature/permReload
Also Reload Plugin-Defined Permissions
This commit is contained in:
commit
c385ec89b5
2 changed files with 11 additions and 2 deletions
|
@ -42,8 +42,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
import org.bukkit.craftbukkit.generator.CraftChunkData;
|
||||
import org.bukkit.craftbukkit.help.SimpleHelpMap;
|
||||
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
|
||||
((SimplePluginManager) pluginManager).clearPermissions();
|
||||
loadCustomPermissions();
|
||||
});
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue