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
2022-07-09 01:01:42 +02:00
diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java
2022-09-26 10:02:51 +02:00
index 1e9105cf5ab2ff0ee847fafd00b41e1bd47f1d9e..65ee888280f917ccd11146505b7389513280a863 100644
2022-07-09 01:01:42 +02:00
--- a/src/main/java/io/papermc/paper/command/PaperCommand.java
+++ b/src/main/java/io/papermc/paper/command/PaperCommand.java
2022-09-26 10:02:51 +02:00
@@ -78,7 +78,7 @@ public final class PaperCommand extends Command {
2022-07-09 01:01:42 +02:00
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());
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-12-16 02:16:34 +01:00
index 3fc2354df83cf4a9d3f18decc996beef90c5d9a1..56783cacf0b2e3042ce8cdb1fd3745b6b19d3226 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-12-16 02:16:34 +01:00
@@ -2649,6 +2649,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);