mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +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
|
||||
+++ b/src/main/java/org/bukkit/command/Command.java
|
||||
@@ -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.");
|
||||
+ // Paper start
|
||||
+ String bukkitPermissionMessage = Bukkit.getPermissionMessage();
|
||||
+ if (org.apache.commons.lang.StringUtils.isNotBlank(bukkitPermissionMessage)) {
|
||||
+ target.sendMessage(bukkitPermissionMessage);
|
||||
+ }
|
||||
- } else if (permissionMessage.length() != 0) {
|
||||
+ // Paper start
|
||||
+ String permissionMessage = this.permissionMessage != null ? this.permissionMessage : Bukkit.getPermissionMessage();
|
||||
+ if (!permissionMessage.isBlank()) {
|
||||
+ // Paper end
|
||||
} else if (permissionMessage.length() != 0) {
|
||||
for (String line : permissionMessage.replace("<permission>", permission).split("\n")) {
|
||||
target.sendMessage(line);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue