1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-01-31 03:50:36 +01:00

feat: add minimessage tag resolvers overload to CommandSender#sendMessage ()

This commit is contained in:
powercas_gamer 2023-07-23 07:46:40 +02:00
parent a218498234
commit 587085e41a

View file

@ -1963,6 +1963,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ /**
+ * Sends a message with the MiniMessage format to the command sender.
+ * <p>
+ * See <a href="https://docs.advntr.dev/minimessage/">MiniMessage docs</a> and <a href="https://docs.advntr.dev/minimessage/dynamic-replacements">MiniMessage Placeholders docs</a>
+ * for more information on the format.
+ *
+ * @param message MiniMessage content
+ * @param resolvers resolvers to use
+ */
+ default void sendRichMessage(final @NotNull String message, final net.kyori.adventure.text.minimessage.tag.resolver.@NotNull TagResolver... resolvers) {
+ this.sendMessage(net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(message, resolvers));
+ }
+
+ /**
+ * Sends a plain message to the command sender.
+ *
+ * @param message plain message