Commits

md_5 authored ec4d4ef1e89
Fix tab completion for plugins / reload command
No tags

src/main/java/org/bukkit/command/defaults/PluginsCommand.java

Modified
1 1 package org.bukkit.command.defaults;
2 2
3 3 import java.util.Arrays;
4 +import java.util.Collections;
5 +import java.util.List;
4 6
5 7 import org.bukkit.Bukkit;
6 8 import org.bukkit.ChatColor;
7 9 import org.bukkit.command.CommandSender;
8 10 import org.bukkit.plugin.Plugin;
9 11
10 12 public class PluginsCommand extends BukkitCommand {
11 13 public PluginsCommand(String name) {
12 14 super(name);
13 15 this.description = "Gets a list of plugins running on the server";
17 19 }
18 20
19 21 @Override
20 22 public boolean execute(CommandSender sender, String currentAlias, String[] args) {
21 23 if (!testPermission(sender)) return true;
22 24
23 25 sender.sendMessage("Plugins " + getPluginList());
24 26 return true;
25 27 }
26 28
29 + @Override
30 + public List<String> tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException {
31 + return Collections.emptyList();
32 + }
33 +
27 34 private String getPluginList() {
28 35 StringBuilder pluginList = new StringBuilder();
29 36 Plugin[] plugins = Bukkit.getPluginManager().getPlugins();
30 37
31 38 for (Plugin plugin : plugins) {
32 39 if (pluginList.length() > 0) {
33 40 pluginList.append(ChatColor.WHITE);
34 41 pluginList.append(", ");
35 42 }
36 43

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut