2014-08-31 18:56:05 +00:00
|
|
|
From e76f23f838d7d7287d4b9000273d819c8bf70c95 Mon Sep 17 00:00:00 2001
|
2014-07-22 20:25:09 +00:00
|
|
|
From: md_5 <git@md-5.net>
|
|
|
|
Date: Tue, 22 Jul 2014 21:01:32 +1000
|
|
|
|
Subject: [PATCH] Fix slow tab complete for some commands.
|
|
|
|
|
|
|
|
Use online players instead of offline players, which is very slow.
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/command/defaults/WhitelistCommand.java b/src/main/java/org/bukkit/command/defaults/WhitelistCommand.java
|
2014-08-18 15:43:17 +00:00
|
|
|
index b3fa4f8..6559b33 100644
|
2014-07-22 20:25:09 +00:00
|
|
|
--- a/src/main/java/org/bukkit/command/defaults/WhitelistCommand.java
|
|
|
|
+++ b/src/main/java/org/bukkit/command/defaults/WhitelistCommand.java
|
|
|
|
@@ -104,7 +104,7 @@ public class WhitelistCommand extends VanillaCommand {
|
|
|
|
} else if (args.length == 2) {
|
|
|
|
if (args[0].equalsIgnoreCase("add")) {
|
|
|
|
List<String> completions = new ArrayList<String>();
|
|
|
|
- for (OfflinePlayer player : Bukkit.getOfflinePlayers()) {
|
2014-08-18 15:43:17 +00:00
|
|
|
+ for (OfflinePlayer player : Bukkit.getOnlinePlayers()) { // Spigot - well maybe sometimes you haven't turned the whitelist on just yet.
|
2014-07-22 20:25:09 +00:00
|
|
|
String name = player.getName();
|
|
|
|
if (StringUtil.startsWithIgnoreCase(name, args[1]) && !player.isWhitelisted()) {
|
|
|
|
completions.add(name);
|
|
|
|
--
|
|
|
|
1.9.1
|
|
|
|
|