diff options
author | Jake Potrebic <[email protected]> | 2024-06-13 12:04:27 -0700 |
---|---|---|
committer | Jake Potrebic <[email protected]> | 2024-06-13 12:04:27 -0700 |
commit | ec05cb8b38e5af408e4f46071ebbcad351be4d88 (patch) | |
tree | 50c345ce6c34f2c07a546dda8d21edd44896a905 /patches/server/0268-Make-the-default-permission-message-configurable.patch | |
parent | 0b7552272a36e51dc08e8ba731759d0a9a421140 (diff) | |
download | Paper-ec05cb8b38e5af408e4f46071ebbcad351be4d88.tar.gz Paper-ec05cb8b38e5af408e4f46071ebbcad351be4d88.zip |
279
Diffstat (limited to 'patches/server/0268-Make-the-default-permission-message-configurable.patch')
-rw-r--r-- | patches/server/0268-Make-the-default-permission-message-configurable.patch | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/patches/server/0268-Make-the-default-permission-message-configurable.patch b/patches/server/0268-Make-the-default-permission-message-configurable.patch new file mode 100644 index 0000000000..43730fa5bf --- /dev/null +++ b/patches/server/0268-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 2924bf755df7cc2b8d48e4383b56b2777981231d..006cc9b7817e0413a332c21839549b127ad67cb4 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -2867,6 +2867,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); |