From 7997ea59e0a026b7825397d20dadb7fd543caa71 Mon Sep 17 00:00:00 2001
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
Date: Thu, 9 Jun 2022 17:03:05 -0700
Subject: [PATCH] Don't use deprecated permission message method

---
 .../api/Make-the-default-permission-message-configurable.patch  | 2 +-
 .../Make-the-default-permission-message-configurable.patch      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/patches/api/Make-the-default-permission-message-configurable.patch b/patches/api/Make-the-default-permission-message-configurable.patch
index a2f5763802..d29841a85e 100644
--- a/patches/api/Make-the-default-permission-message-configurable.patch
+++ b/patches/api/Make-the-default-permission-message-configurable.patch
@@ -77,7 +77,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 -            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 - use components for permissionMessage
 -        } else if (!permissionMessage.equals(net.kyori.adventure.text.Component.empty())) {
-+        net.kyori.adventure.text.Component permissionMessage = this.permissionMessage != null ? this.permissionMessage : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(Bukkit.getPermissionMessage());
++        net.kyori.adventure.text.Component permissionMessage = this.permissionMessage != null ? this.permissionMessage : Bukkit.permissionMessage();
 +        if (!permissionMessage.equals(net.kyori.adventure.text.Component.empty())) {
              target.sendMessage(permissionMessage.replaceText(net.kyori.adventure.text.TextReplacementConfig.builder().matchLiteral("<permission>").replacement(permission).build()));
              // Paper end
diff --git a/patches/server/Make-the-default-permission-message-configurable.patch b/patches/server/Make-the-default-permission-message-configurable.patch
index 4b8badec49..f51fe313a8 100644
--- a/patches/server/Make-the-default-permission-message-configurable.patch
+++ b/patches/server/Make-the-default-permission-message-configurable.patch
@@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
      private static boolean testPermission(CommandSender commandSender, String permission) {
          if (commandSender.hasPermission(BASE_PERM + permission) || commandSender.hasPermission("bukkit.command.paper")) return true;
 -        commandSender.sendMessage(text("I'm sorry, but you do not have permission to perform this command. Please contact the server administrators if you believe that this is in error.", RED));
-+        commandSender.sendMessage(Bukkit.getPermissionMessage()); // Sorry, kashike
++        commandSender.sendMessage(Bukkit.permissionMessage());
          return false;
      }