diff --git a/Spigot-API-Patches/Make-plugins-list-alphabetical.patch b/Spigot-API-Patches/Make-plugins-list-alphabetical.patch index 453af989b1..401da7cf91 100644 --- a/Spigot-API-Patches/Make-plugins-list-alphabetical.patch +++ b/Spigot-API-Patches/Make-plugins-list-alphabetical.patch @@ -26,12 +26,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - Plugin[] plugins = Bukkit.getPluginManager().getPlugins(); + // Paper start + TreeMap<String, Plugin> plugins = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); - -- for (Plugin plugin : plugins) { ++ + for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) { + plugins.put(plugin.getDescription().getName(), plugin); + } -+ + +- for (Plugin plugin : plugins) { + StringBuilder pluginList = new StringBuilder(); + for (Map.Entry<String, Plugin> entry : plugins.entrySet()) { if (pluginList.length() > 0) { @@ -58,3 +58,24 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } // Spigot start + @NotNull + private BaseComponent[] getPluginListSpigot() { +- Plugin[] plugins = Bukkit.getPluginManager().getPlugins(); +- ComponentBuilder pluginList = new ComponentBuilder("Plugins (" + plugins.length + "): "); ++ // Paper start ++ TreeMap<String, Plugin> plugins = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); ++ for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) { ++ plugins.put(plugin.getDescription().getName(), plugin); ++ } ++ ComponentBuilder pluginList = new ComponentBuilder("Plugins (" + plugins.size() + "): "); ++ // Paper end + + int index = 0; +- for (Plugin plugin : plugins) { ++ // Paper start ++ for (Map.Entry<String, Plugin> entry : plugins.entrySet()) { ++ Plugin plugin = entry.getValue(); ++ // Paper end + if (index++ > 0) { + pluginList.append(", ", FormatRetention.NONE).color(net.md_5.bungee.api.ChatColor.WHITE); + }