Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-19 04:50:06 +01:00
SPIGOT-2618: Register permissions before plugin enabled.
Brings behaviour in line with command registration, and won't affect plugins which don't already error.
Dieser Commit ist enthalten in:
Ursprung
c74e2a7301
Commit
60c1719354
@ -317,7 +317,7 @@ public final class CraftServer implements Server {
|
|||||||
|
|
||||||
for (Plugin plugin : plugins) {
|
for (Plugin plugin : plugins) {
|
||||||
if ((!plugin.isEnabled()) && (plugin.getDescription().getLoad() == type)) {
|
if ((!plugin.isEnabled()) && (plugin.getDescription().getLoad() == type)) {
|
||||||
loadPlugin(plugin);
|
enablePlugin(plugin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -343,10 +343,8 @@ public final class CraftServer implements Server {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadPlugin(Plugin plugin) {
|
private void enablePlugin(Plugin plugin) {
|
||||||
try {
|
try {
|
||||||
pluginManager.enablePlugin(plugin);
|
|
||||||
|
|
||||||
List<Permission> perms = plugin.getDescription().getPermissions();
|
List<Permission> perms = plugin.getDescription().getPermissions();
|
||||||
|
|
||||||
for (Permission perm : perms) {
|
for (Permission perm : perms) {
|
||||||
@ -356,6 +354,8 @@ public final class CraftServer implements Server {
|
|||||||
getLogger().log(Level.WARNING, "Plugin " + plugin.getDescription().getFullName() + " tried to register permission '" + perm.getName() + "' but it's already registered", ex);
|
getLogger().log(Level.WARNING, "Plugin " + plugin.getDescription().getFullName() + " tried to register permission '" + perm.getName() + "' but it's already registered", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pluginManager.enablePlugin(plugin);
|
||||||
} catch (Throwable ex) {
|
} catch (Throwable ex) {
|
||||||
Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, ex.getMessage() + " loading " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex);
|
Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, ex.getMessage() + " loading " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex);
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren