2019-02-23 17:17:41 +00:00
From bc3c78864ba112943c7d86ca3759deb413bef261 Mon Sep 17 00:00:00 2001
2018-11-18 19:54:38 +00:00
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sun, 18 Nov 2018 19:44:54 +0000
Subject: [PATCH] Make the default permission message configurable
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
2019-02-22 03:41:20 +00:00
index cbabd807..2ab73439 100644
2018-11-18 19:54:38 +00:00
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
2019-02-22 03:41:20 +00:00
@@ -1510,6 +1510,14 @@ public final class Bukkit {
2018-11-18 19:54:38 +00:00
return server.suggestPlayerNamesWhenNullTabCompletions();
}
+ /**
+ *
+ * @return the default no permission message used on the server
+ */
+ public static String getPermissionMessage() {
+ return server.getPermissionMessage();
+ }
+
/**
* Creates a PlayerProfile for the specified uuid, with name as null
* @param uuid UUID to create profile for
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
2019-02-22 03:41:20 +00:00
index 9c5049cd..7c7725a7 100644
2018-11-18 19:54:38 +00:00
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
2019-02-22 03:41:20 +00:00
@@ -1308,6 +1308,12 @@ public interface Server extends PluginMessageRecipient {
2018-11-18 19:54:38 +00:00
*/
boolean suggestPlayerNamesWhenNullTabCompletions();
+ /**
+ *
+ * @return the default no permission message used on the server
+ */
+ String getPermissionMessage();
+
/**
* Creates a PlayerProfile for the specified uuid, with name as null
* @param uuid UUID to create profile for
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
2019-02-22 03:41:20 +00:00
index db7f4428..77171cd1 100644
2018-11-18 19:54:38 +00:00
--- a/src/main/java/org/bukkit/command/Command.java
+++ b/src/main/java/org/bukkit/command/Command.java
@@ -180,7 +180,7 @@ public abstract class Command {
}
if (permissionMessage == null) {
2019-01-15 21:12:19 +00:00
- target.sendMessage(ChatColor.RED + "I'm sorry, but you do not have permission to perform this command. Please contact the server administrators if you believe that this is a mistake.");
2018-11-18 19:54:38 +00:00
+ target.sendMessage(Bukkit.getPermissionMessage()); // Paper
} else if (permissionMessage.length() != 0) {
for (String line : permissionMessage.replace("<permission>", permission).split("\n")) {
target.sendMessage(line);
--
2019-01-01 03:15:55 +00:00
2.20.1
2018-11-18 19:54:38 +00:00