aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0286-Make-the-default-permission-message-configurable.patch
diff options
context:
space:
mode:
authorOwen <[email protected]>2022-03-11 15:13:46 -0500
committerGitHub <[email protected]>2022-03-11 21:13:46 +0100
commitea1efef1164aa7653119eb4be000749930e5b4da (patch)
tree104968ec407cf897e14388b14d2bf397844c8279 /patches/server/0286-Make-the-default-permission-message-configurable.patch
parent1790528a6104c7c801e02a6f6d2ec0dda70e2af9 (diff)
downloadPaper-ea1efef1164aa7653119eb4be000749930e5b4da.tar.gz
Paper-ea1efef1164aa7653119eb4be000749930e5b4da.zip
Remove Patches (#7541)
Diffstat (limited to 'patches/server/0286-Make-the-default-permission-message-configurable.patch')
-rw-r--r--patches/server/0286-Make-the-default-permission-message-configurable.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/patches/server/0286-Make-the-default-permission-message-configurable.patch b/patches/server/0286-Make-the-default-permission-message-configurable.patch
new file mode 100644
index 0000000000..f498d52fb4
--- /dev/null
+++ b/patches/server/0286-Make-the-default-permission-message-configurable.patch
@@ -0,0 +1,59 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Shane Freeder <[email protected]>
+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/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
+index 1fa190e098079522e0fe3593fa261c1b7ad4e24b..1eb45df9dca5d0c31ac46709e706136a246cb8ea 100644
+--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java
++++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
+@@ -52,7 +52,7 @@ public class PaperCommand extends Command {
+
+ private static boolean testPermission(CommandSender commandSender, String permission) {
+ if (commandSender.hasPermission(BASE_PERM + permission) || commandSender.hasPermission("bukkit.command.paper")) return true;
+- commandSender.sendMessage(ChatColor.RED + "I'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."); // Sorry, kashike
++ commandSender.sendMessage(Bukkit.getPermissionMessage()); // Sorry, kashike
+ return false;
+ }
+
+diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
+index c1fbff8ccfdb95aebc330e2621c4fc9c71ebfb9e..36719c689a24c63e7d9a5b40f8c262c182a31b21 100644
+--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
++++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
+@@ -20,6 +20,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;
+@@ -300,6 +301,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));
++ }
++
+ private static void savePlayerData() {
+ Object val = config.get("settings.save-player-data");
+ if (val instanceof Boolean) {
+diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+index 39389c3389eb6b118b662cb77552d198b0b21c05..ba0b22c45e0bdcda7087a262a82405a9efe8cc61 100644
+--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+@@ -2594,6 +2594,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);