From 4a51a54896ff6b55b4944e2d3596b5c78057a057 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 --- ...4-Make-the-default-permission-message-configurable.patch | 4 ++-- ...5-Make-the-default-permission-message-configurable.patch | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/patches/api/0164-Make-the-default-permission-message-configurable.patch b/patches/api/0164-Make-the-default-permission-message-configurable.patch index 035e40e18..2dae0c057 100644 --- a/patches/api/0164-Make-the-default-permission-message-configurable.patch +++ b/patches/api/0164-Make-the-default-permission-message-configurable.patch @@ -66,7 +66,7 @@ index 2042f4963c53d5a903f0de1fec6a9af3a7b2bba4..475fe51ff7a9f1c1ed5048ea59d6d8ba * Creates a PlayerProfile for the specified uuid, with name as null. * diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java -index a26df5f6341d22ecd5e71da59b8f091848e627ad..cefaea8e08fe5e92c9ef2e4725d42e33dd3dac69 100644 +index a26df5f6341d22ecd5e71da59b8f091848e627ad..608b541aef01f33891a492fff5b8400496832c3a 100644 --- a/src/main/java/org/bukkit/command/Command.java +++ b/src/main/java/org/bukkit/command/Command.java @@ -184,10 +184,9 @@ public abstract class Command { @@ -77,7 +77,7 @@ index a26df5f6341d22ecd5e71da59b8f091848e627ad..cefaea8e08fe5e92c9ef2e4725d42e33 - 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("").replacement(permission).build())); // Paper end diff --git a/patches/server/0285-Make-the-default-permission-message-configurable.patch b/patches/server/0285-Make-the-default-permission-message-configurable.patch index 87b64048c..d6b3a718c 100644 --- a/patches/server/0285-Make-the-default-permission-message-configurable.patch +++ b/patches/server/0285-Make-the-default-permission-message-configurable.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Make the default permission message configurable diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java -index b506cd11b76901827cbe66f46db8df400f7015de..bb8f2a0c9fc1fd9bc50dc82934407e12bbd98276 100644 +index b506cd11b76901827cbe66f46db8df400f7015de..13a5062e539f6f43e6fe582318c36302bd6520ee 100644 --- a/src/main/java/com/destroystokyo/paper/PaperCommand.java +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java @@ -57,7 +57,7 @@ public class PaperCommand extends Command { @@ -13,12 +13,12 @@ index b506cd11b76901827cbe66f46db8df400f7015de..bb8f2a0c9fc1fd9bc50dc82934407e12 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; } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 9a9b6ceab49e78a6b5523825e571186f6f610212..80e508aa9fc9cf41ecfc528086cc9eebde7b5728 100644 +index 6a2e65401130ca885864e9952f594237d089769d..62fb88baefcf22a49474ea8362db8f99b7318687 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -2586,6 +2586,16 @@ public final class CraftServer implements Server {