mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +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.");
|
||||||
+ // Paper start
|
- } else if (permissionMessage.length() != 0) {
|
||||||
+ String bukkitPermissionMessage = Bukkit.getPermissionMessage();
|
+ // Paper start
|
||||||
+ if (org.apache.commons.lang.StringUtils.isNotBlank(bukkitPermissionMessage)) {
|
+ String permissionMessage = this.permissionMessage != null ? this.permissionMessage : Bukkit.getPermissionMessage();
|
||||||
+ target.sendMessage(bukkitPermissionMessage);
|
+ if (!permissionMessage.isBlank()) {
|
||||||
+ }
|
|
||||||
+ // 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