Fix suggest-player-names-when-null-tab-completions - Fixes #3803

Seems changes upstream broke original implementation

moved check into method that actually does the injection
This commit is contained in:
Aikar 2020-07-05 03:11:54 -04:00
parent 3aa6d3b3c0
commit 198b0b96f3

View file

@ -45,15 +45,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ boolean suggestPlayerNamesWhenNullTabCompletions();
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/command/PluginCommand.java b/src/main/java/org/bukkit/command/PluginCommand.java
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/command/PluginCommand.java
+++ b/src/main/java/org/bukkit/command/PluginCommand.java
@@ -0,0 +0,0 @@ public final class PluginCommand extends Command implements PluginIdentifiableCo
--- a/src/main/java/org/bukkit/command/Command.java
+++ b/src/main/java/org/bukkit/command/Command.java
@@ -0,0 +0,0 @@ public abstract class Command {
Validate.notNull(args, "Arguments cannot be null");
Validate.notNull(alias, "Alias cannot be null");
- if (args.length == 0) {
+ if (args.length == 0 || !sender.getServer().suggestPlayerNamesWhenNullTabCompletions()) { // Paper - allow preventing player name suggestions by default) {
return ImmutableList.of();
}
if (completions == null) {
+ if (!sender.getServer().suggestPlayerNamesWhenNullTabCompletions()) return com.google.common.collect.ImmutableList.of(); // Paper - allow preventing player name suggestions by default
return super.tabComplete(sender, alias, args);
}
return completions;