Add descriptions to config entries in commands

This commit is contained in:
s809
2025-01-01 20:32:17 +05:00
parent 97af075c7d
commit f4126f5378
2 changed files with 9 additions and 2 deletions
@@ -57,7 +57,14 @@ public class ConfigCommand extends AbstractCommand
}
LiteralArgumentBuilder<CommandSourceStack> subcommand = literal(configEntry.getServersideShortName())
.executes(commandContext -> this.sendSuccessResponse(commandContext, "Current value of ["+configEntry.getServersideShortName()+"] is ["+configEntry.get()+"]"));
.executes(commandContext -> this.sendSuccessResponse(commandContext,
"\n" +
"Description of §l" + configEntry.getServersideShortName() + "§r:\n" +
"§o" + configEntry.getComment().trim() + "§r\n" +
"§7Config file name: §f" + configEntry.name + "§7, category: §f" + configEntry.category + "\n" +
"\n" +
"Current value of " + configEntry.getServersideShortName() + " is §n" + configEntry.get() + "§r"
));
ToIntBiFunction<CommandContext<CommandSourceStack>, Object> updateConfigValue = (commandContext, value) -> {
configEntry.set(value);