2015-04-09 05:41:04 +02:00
|
|
|
From 1d140f622f04696aac22e605d2ed49e0688dbcdc Mon Sep 17 00:00:00 2001
|
2014-07-22 22:25:09 +02: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-12-10 02:58:37 +01:00
|
|
|
index 92de43c..855f560 100644
|
2014-07-22 22:25:09 +02:00
|
|
|
--- a/src/main/java/org/bukkit/command/defaults/WhitelistCommand.java
|
|
|
|
+++ b/src/main/java/org/bukkit/command/defaults/WhitelistCommand.java
|
2014-12-10 02:58:37 +01:00
|
|
|
@@ -105,7 +105,7 @@ public class WhitelistCommand extends VanillaCommand {
|
2014-07-22 22:25:09 +02:00
|
|
|
} else if (args.length == 2) {
|
|
|
|
if (args[0].equalsIgnoreCase("add")) {
|
|
|
|
List<String> completions = new ArrayList<String>();
|
|
|
|
- for (OfflinePlayer player : Bukkit.getOfflinePlayers()) {
|
2014-08-18 17:43:17 +02:00
|
|
|
+ for (OfflinePlayer player : Bukkit.getOnlinePlayers()) { // Spigot - well maybe sometimes you haven't turned the whitelist on just yet.
|
2014-07-22 22:25:09 +02:00
|
|
|
String name = player.getName();
|
|
|
|
if (StringUtil.startsWithIgnoreCase(name, args[1]) && !player.isWhitelisted()) {
|
|
|
|
completions.add(name);
|
|
|
|
--
|
2014-11-28 02:17:45 +01:00
|
|
|
2.1.0
|
2014-07-22 22:25:09 +02:00
|
|
|
|