Skip to content

Commit

Permalink
Change component style
Browse files Browse the repository at this point in the history
  • Loading branch information
Angelillo15 committed Aug 26, 2024
1 parent 10abdae commit 6de8391
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.*;
Expand Down Expand Up @@ -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(
"<b>|</b> <white>/%s %s</white> - <gray>%s</gray>",
label,
data.name(),
data.description()
)
);

sender.sendMessage(component);
});
Expand Down

0 comments on commit 6de8391

Please sign in to comment.