diff --git a/patches/api/Add-BaseComponent-sendMessage-methods-to-CommandSend.patch b/patches/api/Add-BaseComponent-sendMessage-methods-to-CommandSend.patch index 8f878513fa..f3e6d2427f 100644 --- a/patches/api/Add-BaseComponent-sendMessage-methods-to-CommandSend.patch +++ b/patches/api/Add-BaseComponent-sendMessage-methods-to-CommandSend.patch @@ -19,8 +19,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import org.bukkit.permissions.Permissible; import org.jetbrains.annotations.NotNull; @@ -0,0 +0,0 @@ public interface CommandSender extends net.kyori.adventure.audience.Audience, Pe - default void sendMessage(final @NotNull net.kyori.adventure.identity.Identity identity, final @NotNull net.kyori.adventure.text.Component message, final @NotNull net.kyori.adventure.audience.MessageType type) { - this.sendMessage(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(message)); + default void sendPlainMessage(final @NotNull String message) { + this.sendMessage(net.kyori.adventure.text.Component.text(message)); } + + /** diff --git a/patches/api/Adventure.patch b/patches/api/Adventure.patch index 9f8b6531df..d15affe453 100644 --- a/patches/api/Adventure.patch +++ b/patches/api/Adventure.patch @@ -1502,6 +1502,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + default void sendMessage(final @NotNull net.kyori.adventure.identity.Identity identity, final @NotNull net.kyori.adventure.text.Component message, final @NotNull net.kyori.adventure.audience.MessageType type) { + this.sendMessage(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(message)); + } ++ ++ /** ++ * Sends a message with the MiniMessage format to the command sender. ++ *

++ * See MiniMessage docs ++ * for more information on the format. ++ * ++ * @param message MiniMessage content ++ */ ++ default void sendRichMessage(final @NotNull String message) { ++ this.sendMessage(net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(message)); ++ } ++ ++ /** ++ * Sends a plain message to the command sender. ++ * ++ * @param message plain message ++ */ ++ default void sendPlainMessage(final @NotNull String message) { ++ this.sendMessage(net.kyori.adventure.text.Component.text(message)); ++ } + // Paper end } diff --git a/src/main/java/org/bukkit/command/PluginCommandYamlParser.java b/src/main/java/org/bukkit/command/PluginCommandYamlParser.java