mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Permission message upgrades (#5932)
* Permission message upgrades * Allow for blank lines after split * the future is now :o
This commit is contained in:
parent
58c3edcb08
commit
5166ece434
1 changed files with 7 additions and 7 deletions
|
@ -47,16 +47,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
--- a/src/main/java/org/bukkit/command/Command.java
|
--- a/src/main/java/org/bukkit/command/Command.java
|
||||||
+++ b/src/main/java/org/bukkit/command/Command.java
|
+++ b/src/main/java/org/bukkit/command/Command.java
|
||||||
@@ -0,0 +0,0 @@ public abstract class Command {
|
@@ -0,0 +0,0 @@ public abstract class Command {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (permissionMessage == null) {
|
- if (permissionMessage == null) {
|
||||||
- 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.");
|
- 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.");
|
||||||
|
- } else if (permissionMessage.length() != 0) {
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ String bukkitPermissionMessage = Bukkit.getPermissionMessage();
|
+ String permissionMessage = this.permissionMessage != null ? this.permissionMessage : Bukkit.getPermissionMessage();
|
||||||
+ if (org.apache.commons.lang.StringUtils.isNotBlank(bukkitPermissionMessage)) {
|
+ if (!permissionMessage.isBlank()) {
|
||||||
+ target.sendMessage(bukkitPermissionMessage);
|
|
||||||
+ }
|
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
} else if (permissionMessage.length() != 0) {
|
|
||||||
for (String line : permissionMessage.replace("<permission>", permission).split("\n")) {
|
for (String line : permissionMessage.replace("<permission>", permission).split("\n")) {
|
||||||
target.sendMessage(line);
|
target.sendMessage(line);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue