From 585b174cbab8290d5e90614bb29bff1fd4ca50c8 Mon Sep 17 00:00:00 2001 From: Memencio Date: Wed, 6 Nov 2024 15:41:37 -0400 Subject: [PATCH] feat: list available subcommands in UnSignedVelocity main command --- .../commands/UnSignedVelocityCommand.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/_4drian3d/unsignedvelocity/commands/UnSignedVelocityCommand.java b/src/main/java/io/github/_4drian3d/unsignedvelocity/commands/UnSignedVelocityCommand.java index a4a6db6..f6e4d32 100644 --- a/src/main/java/io/github/_4drian3d/unsignedvelocity/commands/UnSignedVelocityCommand.java +++ b/src/main/java/io/github/_4drian3d/unsignedvelocity/commands/UnSignedVelocityCommand.java @@ -6,6 +6,7 @@ import com.velocitypowered.api.command.BrigadierCommand; import com.velocitypowered.api.command.CommandSource; import io.github._4drian3d.unsignedvelocity.UnSignedVelocity; +import io.github._4drian3d.unsignedvelocity.utils.Constants; import net.kyori.adventure.text.Component; import java.util.List; @@ -20,8 +21,11 @@ public static BrigadierCommand createBrigadierCommand(final UnSignedVelocity plu .executes(context -> { CommandSource source = context.getSource(); - Component message = miniMessage().deserialize("UnSignedVelocity"); - source.sendMessage(message); + List messages = List.of(miniMessage().deserialize("<#6892bd>You are using UnSignedVelocity <#6892bd>" + Constants.VERSION + " by 4drian3d and MemencioPerez"), + miniMessage().deserialize("<#6892bd>Available commands:"), + miniMessage().deserialize("<#6892bd>/unsignedvelocity reload - <#6892bd>Reloads the plugin configuration and packet listeners"), + miniMessage().deserialize("<#6892bd>/unsignedvelocity status - <#6892bd>Displays the plugin status")); + messages.forEach(source::sendMessage); return Command.SINGLE_SUCCESS; }) .then(BrigadierCommand.requiredArgumentBuilder("subcommand", StringArgumentType.word())