geforkt von Mirrors/Paper
41 Zeilen
2.2 KiB
Diff
41 Zeilen
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 1e9105cf5ab2ff0ee847fafd00b41e1bd47f1d9e..65ee888280f917ccd11146505b7389513280a863 100644
|
|
--- a/src/main/java/io/papermc/paper/command/PaperCommand.java
|
|
+++ b/src/main/java/io/papermc/paper/command/PaperCommand.java
|
|
@@ -78,7 +78,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 d1f73e325f53c838a6761c0d0f66fd32a887dc51..6a893d44ee85d53ce131ba6c35bbb8c8bfe87b0a 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);
|