diff options
author | Kyle Wood <[email protected]> | 2021-04-24 17:01:33 -0500 |
---|---|---|
committer | Kyle Wood <[email protected]> | 2021-04-25 18:37:43 -0500 |
commit | 3093b81fee3064603c368ab934eddf66ce304433 (patch) | |
tree | cb99f05b5f31de92c41af4cc40b4bef5f3cbf573 /Spigot-API-Patches-Unmapped/0050-Add-configuration-option-to-prevent-player-names-fro.patch | |
parent | 1af696a05d21cbdd7b5a7170f95598c013257588 (diff) | |
download | Paper-3093b81fee3064603c368ab934eddf66ce304433.tar.gz Paper-3093b81fee3064603c368ab934eddf66ce304433.zip |
Move patches
Diffstat (limited to 'Spigot-API-Patches-Unmapped/0050-Add-configuration-option-to-prevent-player-names-fro.patch')
-rw-r--r-- | Spigot-API-Patches-Unmapped/0050-Add-configuration-option-to-prevent-player-names-fro.patch | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/Spigot-API-Patches-Unmapped/0050-Add-configuration-option-to-prevent-player-names-fro.patch b/Spigot-API-Patches-Unmapped/0050-Add-configuration-option-to-prevent-player-names-fro.patch new file mode 100644 index 0000000000..929cd00666 --- /dev/null +++ b/Spigot-API-Patches-Unmapped/0050-Add-configuration-option-to-prevent-player-names-fro.patch @@ -0,0 +1,60 @@ +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 555ef4c187ce0c83cc29af145694ec9c448d452e..2527e896a4409326ea2612723b829696d44fc199 100644 +--- a/src/main/java/org/bukkit/Bukkit.java ++++ b/src/main/java/org/bukkit/Bukkit.java +@@ -1756,6 +1756,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 9d81f25e39d345b797f73855a802b186d77f6d12..7d94242b2f8ecb537b3140f9d6f706d3e266c456 100644 +--- a/src/main/java/org/bukkit/Server.java ++++ b/src/main/java/org/bukkit/Server.java +@@ -1542,4 +1542,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 03bdc1622791e1206406c87065978688d602e39e..7c80dc54776d0d66f7816b77136f6dbd9b801704 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(); + } + |