diff options
author | Jason Penilla <[email protected]> | 2021-11-23 00:57:41 -0800 |
---|---|---|
committer | MiniDigger | Martin <[email protected]> | 2021-11-30 19:26:33 +0100 |
commit | a8ef7aa56f260dbb9fccdd88354b34ee3d110e8f (patch) | |
tree | ea651b6241e94ad2b023d8961426e9cbf51e7521 /patches/api/0052-Add-configuration-option-to-prevent-player-names-fro.patch | |
parent | 79b873c90104812163f1e87ae5020779300eb347 (diff) | |
download | Paper-a8ef7aa56f260dbb9fccdd88354b34ee3d110e8f.tar.gz Paper-a8ef7aa56f260dbb9fccdd88354b34ee3d110e8f.zip |
Prepare for updating server patches
Diffstat (limited to 'patches/api/0052-Add-configuration-option-to-prevent-player-names-fro.patch')
-rw-r--r-- | patches/api/0052-Add-configuration-option-to-prevent-player-names-fro.patch | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/patches/api/0052-Add-configuration-option-to-prevent-player-names-fro.patch b/patches/api/0052-Add-configuration-option-to-prevent-player-names-fro.patch deleted file mode 100644 index 123d3d08e9..0000000000 --- a/patches/api/0052-Add-configuration-option-to-prevent-player-names-fro.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: kashike <[email protected]> -Date: Fri, 9 Jun 2017 07:24:24 -0700 -Subject: [PATCH] Add configuration option to prevent player names from being - suggested - - -diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 356a270e9f831e21dc7fd947c2bec72e0840145a..282bd71697aff52d43bce0a3543a3ec50a5b7b1b 100644 ---- a/src/main/java/org/bukkit/Bukkit.java -+++ b/src/main/java/org/bukkit/Bukkit.java -@@ -1906,6 +1906,16 @@ public final class Bukkit { - public static boolean reloadCommandAliases() { - return server.reloadCommandAliases(); - } -+ -+ /** -+ * Checks if player names should be suggested when a command returns {@code null} as -+ * their tab completion result. -+ * -+ * @return true if player names should be suggested -+ */ -+ public static boolean suggestPlayerNamesWhenNullTabCompletions() { -+ return server.suggestPlayerNamesWhenNullTabCompletions(); -+ } - // Paper end - - @NotNull -diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index c0bd764744b101856ef4fa068b5218688b156ecf..2de18d69ad80fe872b36a4975b354cb144b3a302 100644 ---- a/src/main/java/org/bukkit/Server.java -+++ b/src/main/java/org/bukkit/Server.java -@@ -1674,4 +1674,14 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi - void reloadPermissions(); // Paper - - boolean reloadCommandAliases(); // Paper -+ -+ // Paper start - allow preventing player name suggestions by default -+ /** -+ * Checks if player names should be suggested when a command returns {@code null} as -+ * their tab completion result. -+ * -+ * @return true if player names should be suggested -+ */ -+ boolean suggestPlayerNamesWhenNullTabCompletions(); -+ // Paper end - } -diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java -index c4dcafac892169a7bfcc065701fffb43c6cfdf44..b1152f4dede61383232cc6713d448840612eac13 100644 ---- a/src/main/java/org/bukkit/command/Command.java -+++ b/src/main/java/org/bukkit/command/Command.java -@@ -99,7 +99,7 @@ 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(); - } - |