From 6de8391172daea47c87dc36bc96e9e423e71871a Mon Sep 17 00:00:00 2001 From: Angelillo15 Date: Tue, 27 Aug 2024 01:55:14 +0200 Subject: [PATCH] Change component style --- .../java/com/nookure/core/command/CommandParent.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/NookCore-Command/src/main/java/com/nookure/core/command/CommandParent.java b/NookCore-Command/src/main/java/com/nookure/core/command/CommandParent.java index 2448473..a9d2b46 100644 --- a/NookCore-Command/src/main/java/com/nookure/core/command/CommandParent.java +++ b/NookCore-Command/src/main/java/com/nookure/core/command/CommandParent.java @@ -11,6 +11,7 @@ import net.kyori.adventure.text.format.NamedTextColor; import net.kyori.adventure.text.format.Style; import net.kyori.adventure.text.format.TextDecoration; +import net.kyori.adventure.text.minimessage.MiniMessage; import org.jetbrains.annotations.NotNull; import java.util.*; @@ -75,9 +76,14 @@ public void sendHelp(@NotNull CommandSender sender, @NotNull String label) { subCommandData.forEach((name, data) -> { - Component component = Component.text("|").style(Style.style(color, TextDecoration.BOLD)) - .append(Component.text(" /" + label + " " + data.name() + " ").style(Style.style(NamedTextColor.WHITE))) - .append(Component.text("- " + data.description()).style(Style.style(NamedTextColor.DARK_GRAY))); + final Component component = MiniMessage.miniMessage().deserialize( + String.format( + "| /%s %s - %s", + label, + data.name(), + data.description() + ) + ); sender.sendMessage(component); });