Skip to content

Commit

Permalink
Fix slow tab complete for some commands.
Browse files Browse the repository at this point in the history
Use online players instead of offline players, which is very slow.
  • Loading branch information
md-5 authored and SpigotMC committed Sep 4, 2014
1 parent b2b8924 commit 14ece5f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public List<String> tabComplete(CommandSender sender, String alias, String[] arg
} else if (args.length == 2) {
if (args[0].equalsIgnoreCase("add")) {
List<String> completions = new ArrayList<String>();
for (OfflinePlayer player : Bukkit.getOfflinePlayers()) {
for (OfflinePlayer player : Bukkit.getOnlinePlayers()) { // Spigot - well maybe sometimes you haven't turned the whitelist on just yet.
String name = player.getName();
if (StringUtil.startsWithIgnoreCase(name, args[1]) && !player.isWhitelisted()) {
completions.add(name);
Expand Down

0 comments on commit 14ece5f

Please sign in to comment.