geforkt von Mirrors/Paper
Try to determine plugin name on bad plugin command registration
Dieser Commit ist enthalten in:
Ursprung
81f624837f
Commit
3b3f85f88f
@ -2085,13 +2085,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ public static Timing getCommandTiming(String pluginName, Command command) {
|
||||
+ Plugin plugin = null;
|
||||
+ final Server server = Bukkit.getServer();
|
||||
+ if (!("minecraft".equals(pluginName) || "bukkit".equals(pluginName) || "Spigot".equals(pluginName) ||
|
||||
+ server == null)) {
|
||||
+ if (!( server == null || pluginName == null ||
|
||||
+ "minecraft".equals(pluginName) || "bukkit".equals(pluginName) ||
|
||||
+ "spigot".equalsIgnoreCase(pluginName) || "paper".equals(pluginName)
|
||||
+ )) {
|
||||
+ plugin = server.getPluginManager().getPlugin(pluginName);
|
||||
+ if (plugin == null) {
|
||||
+ // Plugin is passing custom fallback prefix, try to look up by class loader
|
||||
+ plugin = getPluginByClassloader(command.getClass());
|
||||
+ }
|
||||
+ }
|
||||
+ if (plugin == null) {
|
||||
+ // Plugin is passing custom fallback prefix, try to look up by class loader
|
||||
+ plugin = getPluginByClassloader(command.getClass());
|
||||
+ }
|
||||
+ if (plugin == null) {
|
||||
+ return Timings.ofSafe("Command: " + pluginName + ":" + command.getTimingName());
|
||||
@ -2906,7 +2908,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.commandMap = commandMap;
|
||||
+ // Paper start - Some plugins do things the wrong way, try and account for that
|
||||
+ if (this.timings == null) {
|
||||
+ this.timings = co.aikar.timings.TimingsManager.getCommandTiming("unknown", this);
|
||||
+ this.timings = co.aikar.timings.TimingsManager.getCommandTiming(null, this);
|
||||
+ }
|
||||
+ // Paper end
|
||||
return true;
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren