New command system #7

Merged
Fascinated merged 3 commits from Rainnny/Bat:master into master 2024-07-04 12:58:35 +00:00
Showing only changes of commit 47b4796695 - Show all commits

@ -103,6 +103,9 @@ public abstract class BatCommand {
} }
command.setSubcommandData(new SubcommandData(command.getInfo().getName(), command.getInfo().getDescription())); command.setSubcommandData(new SubcommandData(command.getInfo().getName(), command.getInfo().getDescription()));
for (OptionData option : command.getCommandData().getOptions()) {
command.getSubcommandData().addOptions(option);
}
commandData.addSubcommands(command.getSubcommandData()); commandData.addSubcommands(command.getSubcommandData());
subCommands.put(command.getInfo().getName(), command); subCommands.put(command.getInfo().getName(), command);
} }
@ -115,10 +118,6 @@ public abstract class BatCommand {
* @param options the options to add * @param options the options to add
*/ */
protected final void addOptions(OptionData... options) { protected final void addOptions(OptionData... options) {
if (subcommandData != null) { commandData.addOptions(options);
subcommandData.addOptions(options);
} else {
commandData.addOptions(options);
}
} }
} }