From 2ab07152263086e59b1cbafa48db1b191769f3de Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 22 Dec 2014 20:02:19 +1100 Subject: [PATCH] Fix server command to properly tab complete, be case insensitive. --- .../net/md_5/bungee/module/cmd/server/CommandServer.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java b/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java index 88c53e33..d7746534 100644 --- a/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java +++ b/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java @@ -76,14 +76,16 @@ public class CommandServer extends Command implements TabExecutor } @Override - public Iterable onTabComplete(final CommandSender sender, String[] args) + public Iterable onTabComplete(final CommandSender sender, final String[] args) { return ( args.length != 0 ) ? Collections.EMPTY_LIST : Iterables.transform( Iterables.filter( ProxyServer.getInstance().getServers().values(), new Predicate() { + private final String lower = args[0].toLowerCase(); + @Override public boolean apply(ServerInfo input) { - return input.canAccess( sender ); + return input.getName().toLowerCase().startsWith( lower ) && input.canAccess( sender ); } } ), new Function() {