diff options
author | Nassim Jahnke <[email protected]> | 2022-10-02 09:56:36 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2022-10-02 09:56:36 +0200 |
commit | 928bcc8d3a058221146cea1de7d42d7e178e78f2 (patch) | |
tree | fdb518a8812097f983c41d36ea693baf5c208554 /patches/api/0163-Make-the-default-permission-message-configurable.patch | |
parent | ec3cfa9b7f147cf097692144f665893748fadc3b (diff) | |
download | Paper-928bcc8d3a058221146cea1de7d42d7e178e78f2.tar.gz Paper-928bcc8d3a058221146cea1de7d42d7e178e78f2.zip |
Updated Upstream (Bukkit/CraftBukkit) (#8430)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
09943450 Update SnakeYAML version
5515734f SPIGOT-7162: Incorrect description for Entity#getVehicle javadoc
6f82b381 PR-788: Add getHand() to all relevant events
CraftBukkit Changes:
aaf484f6f SPIGOT-7163: CraftMerchantRecipe doesn't copy demand and specialPrice from BukkitMerchantRecipe
5329dd6fd PR-1107: Add getHand() to all relevant events
93061706e SPIGOT-7045: Ocelots never spawn with babies with spawn reason OCELOT_BABY
Diffstat (limited to 'patches/api/0163-Make-the-default-permission-message-configurable.patch')
-rw-r--r-- | patches/api/0163-Make-the-default-permission-message-configurable.patch | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/patches/api/0163-Make-the-default-permission-message-configurable.patch b/patches/api/0163-Make-the-default-permission-message-configurable.patch new file mode 100644 index 0000000000..780b707eab --- /dev/null +++ b/patches/api/0163-Make-the-default-permission-message-configurable.patch @@ -0,0 +1,84 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shane Freeder <[email protected]> +Date: Sun, 18 Nov 2018 19:44:54 +0000 +Subject: [PATCH] Make the default permission message configurable + + +diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java +index 303e539338383d0d7825b873611ca5843ee1c0a3..00295e256c0def25dd3e552ef67eea06ab01ad15 100644 +--- a/src/main/java/org/bukkit/Bukkit.java ++++ b/src/main/java/org/bukkit/Bukkit.java +@@ -2193,6 +2193,28 @@ public final class Bukkit { + return server.suggestPlayerNamesWhenNullTabCompletions(); + } + ++ /** ++ * Gets the default no permission message used on the server ++ * ++ * @return the default message ++ * @deprecated use {@link #permissionMessage()} ++ */ ++ @NotNull ++ @Deprecated ++ public static String getPermissionMessage() { ++ return server.getPermissionMessage(); ++ } ++ ++ /** ++ * Gets the default no permission message used on the server ++ * ++ * @return the default message ++ */ ++ @NotNull ++ public static net.kyori.adventure.text.Component permissionMessage() { ++ return server.permissionMessage(); ++ } ++ + /** + * Creates a PlayerProfile for the specified uuid, with name as null. + * +diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java +index b0e6446c0dc49088878d7ae453dc3eee8b346f4e..dc26cf95f1769da76dd4d768a0912c1f5346d83e 100644 +--- a/src/main/java/org/bukkit/Server.java ++++ b/src/main/java/org/bukkit/Server.java +@@ -1905,6 +1905,23 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi + */ + boolean suggestPlayerNamesWhenNullTabCompletions(); + ++ /** ++ * Gets the default no permission message used on the server ++ * ++ * @return the default message ++ * @deprecated use {@link #permissionMessage()} ++ */ ++ @NotNull ++ @Deprecated ++ String getPermissionMessage(); ++ ++ /** ++ * Gets the default no permission message used on the server ++ * ++ * @return the default message ++ */ ++ @NotNull net.kyori.adventure.text.Component permissionMessage(); ++ + /** + * 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..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 { + return true; + } + +- 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 - 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 : 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 + } |