aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0160-Make-the-default-permission-message-configurable.patch
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2023-11-22 20:56:28 -0800
committerGitHub <[email protected]>2023-11-22 20:56:28 -0800
commit96d5e6ca481591842f44d05ab2451f943be6a7c7 (patch)
treead35d855fa33f6feb8e365ce12aa312bd225ff3f /patches/api/0160-Make-the-default-permission-message-configurable.patch
parente1cd9e59e53aabd50e501cb01feee277a8f69902 (diff)
downloadPaper-96d5e6ca481591842f44d05ab2451f943be6a7c7.tar.gz
Paper-96d5e6ca481591842f44d05ab2451f943be6a7c7.zip
Code Generation for TypedKeys (#9233)
Currently includes generated key holder classes for types used in the Registry Modification API
Diffstat (limited to 'patches/api/0160-Make-the-default-permission-message-configurable.patch')
-rw-r--r--patches/api/0160-Make-the-default-permission-message-configurable.patch84
1 files changed, 0 insertions, 84 deletions
diff --git a/patches/api/0160-Make-the-default-permission-message-configurable.patch b/patches/api/0160-Make-the-default-permission-message-configurable.patch
deleted file mode 100644
index 2f6f5f4ef1..0000000000
--- a/patches/api/0160-Make-the-default-permission-message-configurable.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-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 e108f8a7376e5f90a1e74c0d5ba40ac6c2818523..40b4d6ee5ef1f6b88e0b85131be399526488cd9e 100644
---- a/src/main/java/org/bukkit/Bukkit.java
-+++ b/src/main/java/org/bukkit/Bukkit.java
-@@ -2344,6 +2344,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 f46e5fc53f202741b97d9264d4b24e4654d19bfb..7223bf91b369822afd355c600d834c30270197f4 100644
---- a/src/main/java/org/bukkit/Server.java
-+++ b/src/main/java/org/bukkit/Server.java
-@@ -2043,6 +2043,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 1c6205cc667bbec8f6aca479f13b3e9cfcd63ab2..b791358f90fe92bc2264d9a26492245763813af3 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
- }