Paper/patches/server/0284-Make-the-default-permission-message-configurable.patch
Nassim Jahnke e6f8284125
Updated Upstream (Bukkit/CraftBukkit) (#8270)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
d43a1e72 SPIGOT-2450: Improve scoreboard criteria API, add missing DisplaySlots
9d6e4847 SPIGOT-7122: New Allay Methods from 1.19.1

CraftBukkit Changes:
c379a6b4e SPIGOT-2450: Improve scoreboard criteria API, add missing DisplaySlots
051fcced1 SPIGOT-7122: New Allay Methods from 1.19.1
2022-08-09 09:18:08 +02:00

41 lines
2.2 KiB
Diff

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/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java
index b3a58bf4b654e336826dc04da9e2f80ff8b9a9a7..cd4936ef114b504df8649fba8f1823d94a4bb2a2 100644
--- a/src/main/java/io/papermc/paper/command/PaperCommand.java
+++ b/src/main/java/io/papermc/paper/command/PaperCommand.java
@@ -74,7 +74,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 71415a6ca5bd61fa5652006ed748048d65a0502b..f8640a3a147322d99dc23a28de0a77692205ff75 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2622,6 +2622,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);