aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0147-Add-configuration-option-to-prevent-player-names-fro.patch
blob: 4cbe763be80d5664701857d72c82def6a7efb203 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: kashike <kashike@vq.lc>
Date: Fri, 9 Jun 2017 07:24:34 -0700
Subject: [PATCH] Add configuration option to prevent player names from being
 suggested


diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 5a83fc21cb6801d597a01fb4a83d30488f30bdb6..295b8390cbc31fc1fcb225f80ec2ff8f0df44321 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -259,4 +259,9 @@ public class PaperConfig {
         flyingKickPlayerMessage = getString("messages.kick.flying-player", flyingKickPlayerMessage);
         flyingKickVehicleMessage = getString("messages.kick.flying-vehicle", flyingKickVehicleMessage);
     }
+
+    public static boolean suggestPlayersWhenNullTabCompletions = true;
+    private static void suggestPlayersWhenNull() {
+        suggestPlayersWhenNullTabCompletions = getBoolean("settings.suggest-player-names-when-null-tab-completions", suggestPlayersWhenNullTabCompletions);
+    }
 }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 3cb57c3b8ca8f29437bea52e9cf3512985f56eb5..9eb4acf93c65a1473e385be317e5d93cd4571d41 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2137,5 +2137,10 @@ public final class CraftServer implements Server {
         commandMap.registerServerAliases();
         return true;
     }
+
+    @Override
+    public boolean suggestPlayerNamesWhenNullTabCompletions() {
+        return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions;
+    }
     // Paper end
 }