Paper/Spigot-Server-Patches/0069-Allow-Reloading-of-Custom-Permissions.patch
Zach Brown c6c6b4f69a
JDK-8176055: Fix heap dumps on Java 8u141+
In Java 8u141 (1.8.0_141-b15) and newer, the
com.sun.management.HotSpotDiagnostic::dumpHeap API has changed and now
requires all heap dumps to end with the .hprof file extension.

Before this change, servers running 8u141 would be unable to perform a
heap dump.

For more information, please see the official release notes of Java 8
Update 141, linked below.
http://www.oracle.com/technetwork/java/javase/8u141-relnotes-3720385.html
2017-07-26 20:28:56 -05:00

36 lines
1.3 KiB
Diff

From 12270cc7b873df6ca91f3342c83b225c60124ef1 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 3007a724b..e8b8e86e8 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1846,5 +1846,20 @@ public final class CraftServer implements Server {
return false;
}
}
+
+ @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.13.3.windows.1