mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 17:01:56 +01:00
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:
parent
3aa6d3b3c0
commit
198b0b96f3
1 changed files with 10 additions and 9 deletions
|
@ -45,15 +45,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ boolean suggestPlayerNamesWhenNullTabCompletions();
|
+ boolean suggestPlayerNamesWhenNullTabCompletions();
|
||||||
+ // Paper end
|
+ // 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
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/org/bukkit/command/PluginCommand.java
|
--- a/src/main/java/org/bukkit/command/Command.java
|
||||||
+++ b/src/main/java/org/bukkit/command/PluginCommand.java
|
+++ b/src/main/java/org/bukkit/command/Command.java
|
||||||
@@ -0,0 +0,0 @@ public final class PluginCommand extends Command implements PluginIdentifiableCo
|
@@ -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;
|
|
||||||
|
|
Loading…
Reference in a new issue