A small library for registering commands in java.
Include the jar file as a library
Have a config.json
file at the run directory of your applicatio
See the config.json
file in the repository for syntax
import tk.craftxbox.cmdlib.CommandStore
import tk.craftxbox.cmdlib.Command
Make a public static variable at the beginning of your main class like this:
public static CommandStore cs = new CommandStore()
Commands are ECMAScript .js files placed at the directory specified in the config.json
The name of the file determines the name of the command
You may also add commands directly to the CommandStore with the registerCommand
method
To execute a command use the exec
method in CommandStore with the name of the command to execute
Google GSON