New command system #7
@ -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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user