Updated Command system (markdown)

Norbi Peti 2020-10-30 22:36:39 +01:00
parent 5ab2be0588
commit 60d40a26ee

@ -30,6 +30,8 @@ What it does and why
Usage: /some <someArg> Usage: /some <someArg>
``` ```
## Subcommand methods
The return type can be void or boolean, if you return false it will display the help text. You can use any simple type (primitives and String) as parameters, and can add more types using `command2.addParamConverter()`. Plugins are also supported via a builtin param converter. Command2 instances can also be obtained using `getManager()` from a command class. The return type can be void or boolean, if you return false it will display the help text. You can use any simple type (primitives and String) as parameters, and can add more types using `command2.addParamConverter()`. Plugins are also supported via a builtin param converter. Command2 instances can also be obtained using `getManager()` from a command class.
You can define optional arguments or text arguments (that can take spaces) and define custom tab completion instead of one based on parameter type. `@CustomTabComplete` lets you define constant strings while `@CustomTabCompleteMethod` lets you use a method to figure out what options are available based on previous arguments. You can define optional arguments or text arguments (that can take spaces) and define custom tab completion instead of one based on parameter type. `@CustomTabComplete` lets you define constant strings while `@CustomTabCompleteMethod` lets you use a method to figure out what options are available based on previous arguments.