aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0270-Make-the-default-permission-message-configurable.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0270-Make-the-default-permission-message-configurable.patch')
-rw-r--r--patches/server/0270-Make-the-default-permission-message-configurable.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/patches/server/0270-Make-the-default-permission-message-configurable.patch b/patches/server/0270-Make-the-default-permission-message-configurable.patch
new file mode 100644
index 0000000000..da3bb83024
--- /dev/null
+++ b/patches/server/0270-Make-the-default-permission-message-configurable.patch
@@ -0,0 +1,40 @@
+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/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java
+index 6d06b772ffb9d47d6a717462a4b2b494544e80ae..69ffd6ea2ce7c6d4f211c6081fcea79afd7eac6c 100644
+--- a/src/main/java/io/papermc/paper/command/PaperCommand.java
++++ b/src/main/java/io/papermc/paper/command/PaperCommand.java
+@@ -73,7 +73,7 @@ public final class PaperCommand extends Command {
+ if (sender.hasPermission(BASE_PERM + permission) || sender.hasPermission("bukkit.command.paper")) {
+ return true;
+ }
+- sender.sendMessage(text("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.", RED));
++ sender.sendMessage(Bukkit.permissionMessage());
+ return false;
+ }
+
+diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+index 6144d3c422fe5cac93e4468a5879cbfba018d1a0..32765f19f6cd4973b4d2d8085637124f8192373c 100644
+--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+@@ -2836,6 +2836,16 @@ public final class CraftServer implements Server {
+ return io.papermc.paper.configuration.GlobalConfiguration.get().commands.suggestPlayerNamesWhenNullTabCompletions;
+ }
+
++ @Override
++ public String getPermissionMessage() {
++ return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacyAmpersand().serialize(io.papermc.paper.configuration.GlobalConfiguration.get().messages.noPermission);
++ }
++
++ @Override
++ public net.kyori.adventure.text.Component permissionMessage() {
++ return io.papermc.paper.configuration.GlobalConfiguration.get().messages.noPermission;
++ }
++
+ @Override
+ public com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nonnull UUID uuid) {
+ return createProfile(uuid, null);