finish help command
This commit is contained in:
parent
47380161c7
commit
e5227d6713
@ -112,7 +112,7 @@ public class CommandClaim {
|
||||
.suggests((ctx, b) -> CommandSource.suggestMatching(new String[]{"default", "true", "false"}, b)).executes(CommandClaim::editGroupPerm))))));
|
||||
builder.then(CommandManager.literal("help").executes(ctx -> CommandHelp.helpMessage(ctx, 0, builder.getArguments()))
|
||||
.then(CommandManager.argument("page", IntegerArgumentType.integer()).executes(ctx -> CommandHelp.helpMessage(ctx, builder.getArguments())))
|
||||
.then(CommandManager.literal("cmd").then(CommandManager.argument("command", StringArgumentType.word()).suggests((ctx, sb)->CommandSource.suggestMatching(CommandHelp.registeredCommands(ctx, builder.getArguments()), sb)).executes(ctx -> CommandHelp.helpCmd(ctx)))));
|
||||
.then(CommandManager.literal("cmd").then(CommandManager.argument("command", StringArgumentType.word()).suggests((ctx, sb) -> CommandSource.suggestMatching(CommandHelp.registeredCommands(ctx, builder.getArguments()), sb)).executes(ctx -> CommandHelp.helpCmd(ctx)))));
|
||||
dispatcher.register(builder);
|
||||
}
|
||||
|
||||
|
@ -54,12 +54,11 @@ public class CommandHelp {
|
||||
String command = StringArgumentType.getString(context, "command");
|
||||
String[] cmdHelp = ConfigHandler.lang.cmdLang.getCommandHelp(command);
|
||||
context.getSource().sendFeedback(PermHelper.simpleColoredText(ConfigHandler.lang.helpCmdHeader, Formatting.DARK_GREEN), false);
|
||||
for(int i = 0; i < cmdHelp.length; i++) {
|
||||
if(i == 0) {
|
||||
for (int i = 0; i < cmdHelp.length; i++) {
|
||||
if (i == 0) {
|
||||
context.getSource().sendFeedback(PermHelper.simpleColoredText(String.format(ConfigHandler.lang.helpCmdSyntax, cmdHelp[i]), Formatting.GOLD), false);
|
||||
context.getSource().sendFeedback(PermHelper.simpleColoredText(""), false);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
context.getSource().sendFeedback(PermHelper.simpleColoredText(cmdHelp[i], Formatting.GOLD), false);
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
|
||||
public class LangConfig {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user