aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0070-Allow-Reloading-of-Custom-Permissions.patch
diff options
context:
space:
mode:
authorZach Brown <[email protected]>2017-04-22 01:16:45 -0500
committerZach Brown <[email protected]>2017-04-22 01:16:45 -0500
commit2db4e57e4d907b01eb00f8af42a27939fb844ed2 (patch)
tree9826459422cda4da803ffd22ecf71bd1db93ce12 /Spigot-Server-Patches/0070-Allow-Reloading-of-Custom-Permissions.patch
parent9db28f00dbcc062955bb094894a0e7efe08f5ba9 (diff)
downloadPaper-2db4e57e4d907b01eb00f8af42a27939fb844ed2.tar.gz
Paper-2db4e57e4d907b01eb00f8af42a27939fb844ed2.zip
Update bStats implementation
Diffstat (limited to 'Spigot-Server-Patches/0070-Allow-Reloading-of-Custom-Permissions.patch')
-rw-r--r--Spigot-Server-Patches/0070-Allow-Reloading-of-Custom-Permissions.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/Spigot-Server-Patches/0070-Allow-Reloading-of-Custom-Permissions.patch b/Spigot-Server-Patches/0070-Allow-Reloading-of-Custom-Permissions.patch
new file mode 100644
index 0000000000..c49e41e974
--- /dev/null
+++ b/Spigot-Server-Patches/0070-Allow-Reloading-of-Custom-Permissions.patch
@@ -0,0 +1,36 @@
+From c17904b073dbf431afdc19c4dc09f444ad6ecb6c Mon Sep 17 00:00:00 2001
+From: William <[email protected]>
+Date: Fri, 18 Mar 2016 03:30:17 -0400
+Subject: [PATCH] Allow Reloading of Custom Permissions
+
+https://github.com/PaperMC/Paper/issues/49
+
+diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+index 9df6c0ebb..e77307c35 100644
+--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+@@ -1827,4 +1827,21 @@ public final class CraftServer implements Server {
+ {
+ return spigot;
+ }
++
++ // Paper start
++ @Override
++ 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
+ }
+--
+2.12.2
+