aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/unapplied/server/0264-Make-the-default-permission-message-configurable.patch
diff options
context:
space:
mode:
authorNassim Jahnke <[email protected]>2024-12-03 17:58:41 +0100
committerNassim Jahnke <[email protected]>2024-12-03 17:58:41 +0100
commitc0a3d51ab35930e410fcd9752ceaff6c3f581c24 (patch)
treef53076a8b0787d2f544f73f468df94619e5eb1a5 /patches/unapplied/server/0264-Make-the-default-permission-message-configurable.patch
parentda7138233f6392e791d790d1c3407414c855f9c2 (diff)
downloadPaper-c0a3d51ab35930e410fcd9752ceaff6c3f581c24.tar.gz
Paper-c0a3d51ab35930e410fcd9752ceaff6c3f581c24.zip
Start update, apply API patches
Diffstat (limited to 'patches/unapplied/server/0264-Make-the-default-permission-message-configurable.patch')
-rw-r--r--patches/unapplied/server/0264-Make-the-default-permission-message-configurable.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/patches/unapplied/server/0264-Make-the-default-permission-message-configurable.patch b/patches/unapplied/server/0264-Make-the-default-permission-message-configurable.patch
new file mode 100644
index 0000000000..c4e4a36cfc
--- /dev/null
+++ b/patches/unapplied/server/0264-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 5b070d158760789bbcaa984426a55d20767abe4a..e1820a339452cd3388dd7cbb928c5f58779a77b6 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 65856f97a5e6f2cbfec94585d65ec5ae27004f37..aebf3eb257d438d199d18f98755e9515f20abd11 100644
+--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+@@ -2900,6 +2900,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);