mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
21 lines
No EOL
1.3 KiB
Diff
21 lines
No EOL
1.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
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
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/org/bukkit/command/defaults/WhitelistCommand.java
|
|
+++ b/src/main/java/org/bukkit/command/defaults/WhitelistCommand.java
|
|
@@ -0,0 +0,0 @@ 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()) {
|
|
+ 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);
|
|
--
|