diff --git a/Spigot-API-Patches/0063-Make-plugins-list-alphabetical.patch b/Spigot-API-Patches/0063-Make-plugins-list-alphabetical.patch index 2b36db8e47..fb9449b5f1 100644 --- a/Spigot-API-Patches/0063-Make-plugins-list-alphabetical.patch +++ b/Spigot-API-Patches/0063-Make-plugins-list-alphabetical.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Make /plugins list alphabetical diff --git a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java -index e8a7f435fb30da3506b2b4fa8c5675c829edc105..4a75997f93f5c33f19200994562aaff99bdd422f 100644 +index e8a7f435fb30da3506b2b4fa8c5675c829edc105..ba399ee5ab33b4fd8741bce53509a17b1aabc84d 100644 --- a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java +++ b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java @@ -3,6 +3,9 @@ package org.bukkit.command.defaults; @@ -18,7 +18,7 @@ index e8a7f435fb30da3506b2b4fa8c5675c829edc105..4a75997f93f5c33f19200994562aaff9 import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; -@@ -49,24 +52,33 @@ public class PluginsCommand extends BukkitCommand { +@@ -49,34 +52,51 @@ public class PluginsCommand extends BukkitCommand { @NotNull private String getPluginList() { @@ -26,12 +26,12 @@ index e8a7f435fb30da3506b2b4fa8c5675c829edc105..4a75997f93f5c33f19200994562aaff9 - Plugin[] plugins = Bukkit.getPluginManager().getPlugins(); + // Paper start + TreeMap 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 entry : plugins.entrySet()) { if (pluginList.length() > 0) { @@ -58,3 +58,24 @@ index e8a7f435fb30da3506b2b4fa8c5675c829edc105..4a75997f93f5c33f19200994562aaff9 } // Spigot start + @NotNull + private BaseComponent[] getPluginListSpigot() { +- Plugin[] plugins = Bukkit.getPluginManager().getPlugins(); +- ComponentBuilder pluginList = new ComponentBuilder("Plugins (" + plugins.length + "): "); ++ // Paper start ++ TreeMap 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 entry : plugins.entrySet()) { ++ Plugin plugin = entry.getValue(); ++ // Paper end + if (index++ > 0) { + pluginList.append(", ", FormatRetention.NONE).color(net.md_5.bungee.api.ChatColor.WHITE); + }