My Problem:
Based on the command structure I’m going for would it be viable to use the high-level command parsing, or would I need to manually parse them by making the commands implement CommandCallable
? My knowledge is lacking when it comes to the wrapping of GenericArguments
.
Command Structure:
- /animate help
- /animate create <name>
- /animate delete <name> -f
- /animate start <name> -f<num> -d<num> -c<num>
- /animate stop <name>
- /animate list
- /animate <name> frame create <name> -h
- /animate <name> frame duplicate <name|num> [num]
- /animate <name> frame delete <name|num> -f
- /animate <name> frame display <name|num>
- /animate <name> frame update <name|num> -o
- /animate <name> frame list
I was going to have help, create,…,stop and list be child commands of animate and give animate a string argument. And when the user specifies a name (which is just a string) I would then pass off the execution to the frame sub command which would have its child commands and their arguments. And that’s where I’m stuck, the first 6 commands are all fine and dandy until I try to incorporate the frame subcommand that is after a string argument.
My current CommandSpec
is as such:
CommandSpec animate = CommandSpec.builder()
.description(Text.of(Util.PRIMARY_COLOR, "Base animation command"))
.child(createAnimation, "create")
.child(deleteAnimation, "delete")
.child(helpAnimation, "help", "?")
.child(listAnimation, "list")
.child(startAnimation, "start")
.child(stopAnimation, "stop")
.arguments(
GenericArguments.optional(GenericArguments.string(Text.of("animation_name")))
)
.permission(Permissions.ANIMATION_BASE)
.executor(new BaseAnimation())
.build();
In this senerio would it be necessary to use the low level command interface, or is it doable with the higher level CommandExector
?
Much thanks!