aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0319-Make-the-default-permission-message-configurable.patch
blob: 82350df56ea619c0a8cf102dd1a5419ee0b4cf19 (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
37
38
39
40
41
42
43
44
45
46
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sun, 18 Nov 2018 19:49:56 +0000
Subject: [PATCH] Make the default permission message configurable


diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 01d48da8b2f89ad3a615ad10c044c5f0a08ee4ed..f9b1b198299166759fe0bd0a36d8d88c626e06a4 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -19,6 +19,7 @@ import java.util.regex.Pattern;
 import com.google.common.collect.Lists;
 import net.minecraft.server.MinecraftServer;
 import org.bukkit.Bukkit;
+import org.bukkit.ChatColor;
 import org.bukkit.command.Command;
 import org.bukkit.configuration.ConfigurationSection;
 import org.bukkit.configuration.InvalidConfigurationException;
@@ -279,6 +280,11 @@ public class PaperConfig {
         connectionThrottleKickMessage = getString("messages.kick.connection-throttle", connectionThrottleKickMessage);
     }
 
+    public static String noPermissionMessage = "&cI'm sorry, but you do not have permission to perform this command. Please contact the server administrators if you believe that this is in error.";
+    private static void noPermissionMessage() {
+        noPermissionMessage = ChatColor.translateAlternateColorCodes('&', getString("messages.no-permission", noPermissionMessage));
+    }
+
     public static boolean savePlayerData = true;
     private static void savePlayerData() {
         savePlayerData = getBoolean("settings.save-player-data", savePlayerData);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index d7aec47c3ba553fb505b5f956850aa2e9077dd24..97cf3c094ceea2ee5ea8d5fe82ac992caf38bd66 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2266,6 +2266,11 @@ public final class CraftServer implements Server {
         return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions;
     }
 
+    @Override
+    public String getPermissionMessage() {
+        return com.destroystokyo.paper.PaperConfig.noPermissionMessage;
+    }
+
     @Override
     public com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nonnull UUID uuid) {
         return createProfile(uuid, null);