From bea998a6d0af1f6cef5924eaeeb0da3df1abbfe8 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Thu, 22 Mar 2012 21:40:31 -0400 Subject: [PATCH] Added plugin count to the PluginsCommand. By: EvilSeph --- .../java/org/bukkit/command/defaults/PluginsCommand.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/command/defaults/PluginsCommand.java b/paper-api/src/main/java/org/bukkit/command/defaults/PluginsCommand.java index 918b08ad82..93b9e64892 100644 --- a/paper-api/src/main/java/org/bukkit/command/defaults/PluginsCommand.java +++ b/paper-api/src/main/java/org/bukkit/command/defaults/PluginsCommand.java @@ -20,13 +20,14 @@ public class PluginsCommand extends BukkitCommand { public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; - sender.sendMessage("Plugins: " + getPluginList()); + sender.sendMessage("Plugins " + getPluginList()); return true; } private String getPluginList() { StringBuilder pluginList = new StringBuilder(); Plugin[] plugins = Bukkit.getPluginManager().getPlugins(); + int pluginCount = 0; for (Plugin plugin : plugins) { if (pluginList.length() > 0) { @@ -36,8 +37,9 @@ public class PluginsCommand extends BukkitCommand { pluginList.append(plugin.isEnabled() ? ChatColor.GREEN : ChatColor.RED); pluginList.append(plugin.getDescription().getName()); + pluginCount++; } - return pluginList.toString(); + return "(" + pluginCount + "): " + pluginList.toString(); } }