From 5166ece43417a5bc5b8c8c19f5de29f7a1e3d517 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Mon, 21 Jun 2021 09:07:21 -0500 Subject: [PATCH] Permission message upgrades (#5932) * Permission message upgrades * Allow for blank lines after split * the future is now :o --- ...e-default-permission-message-configurable.patch | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/patches/api/Make-the-default-permission-message-configurable.patch b/patches/api/Make-the-default-permission-message-configurable.patch index 903e42a644..308cb38ec9 100644 --- a/patches/api/Make-the-default-permission-message-configurable.patch +++ b/patches/api/Make-the-default-permission-message-configurable.patch @@ -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).split("\n")) { target.sendMessage(line); + }