2022-06-09 10:51:45 +02:00
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/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
2022-06-10 02:03:05 +02:00
index b506cd11b76901827cbe66f46db8df400f7015de..13a5062e539f6f43e6fe582318c36302bd6520ee 100644
2022-06-09 10:51:45 +02:00
--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
2022-06-09 23:43:27 +02:00
@@ -57,7 +57,7 @@ public class PaperCommand extends Command {
2022-06-09 10:51:45 +02:00
private static boolean testPermission(CommandSender commandSender, String permission) {
if (commandSender.hasPermission(BASE_PERM + permission) || commandSender.hasPermission("bukkit.command.paper")) return true;
- commandSender.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));
2022-06-10 02:03:05 +02:00
+ commandSender.sendMessage(Bukkit.permissionMessage());
2022-06-09 10:51:45 +02:00
return false;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
2022-07-03 23:55:56 +02:00
index f13551ecc96ddaffc1b45dc210de1fc7ee119695..1f3a4671527ebbc32ac8ec6b7f766c23bde1d2a3 100644
2022-06-09 10:51:45 +02:00
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
2022-06-20 19:12:05 +02:00
@@ -2608,6 +2608,16 @@ public final class CraftServer implements Server {
2022-06-09 10:51:45 +02:00
return io.papermc.paper.configuration.GlobalConfiguration.get().commands.suggestPlayerNamesWhenNullTabCompletions;
}
+ @Override
+ public String getPermissionMessage() {
2022-06-09 23:11:43 +02:00
+ 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() {
2022-06-09 10:51:45 +02:00
+ return io.papermc.paper.configuration.GlobalConfiguration.get().messages.noPermission;
+ }
+
@Override
public com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nonnull UUID uuid) {
return createProfile(uuid, null);