Paper/patches/server/0067-Allow-Reloading-of-Custom-Permissions.patch
Jake Potrebic ea0b63992c
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9228)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
4727d326 Don't let Sign extend SignSide, mark API as experimental
9b29bdcc PR-845: Add preliminary support for multi sided signs

CraftBukkit Changes:
b346a5f6d PR-1170: Add preliminary support for multi sided signs
86c816189 Update SQLite version
d9324b4bc Fix addition of custom smithing trim / transform recipes

Spigot Changes:
7d7b241e Rebuild patches
2023-05-31 16:36:57 -07:00

36 lines
1.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William <admin@domnian.com>
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 da13de547f4f4343ca3301f1b8684eb3d42d62a1..488c37ef814a8c592f82cfc4197e9dcfd2a9e95c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2585,5 +2585,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
}