Reworked commands

::commands now very pretty, paged and documents each command user has access to including privilege required
Command definitions now support adding documentation in-place.
Adds new command to hot-reload JSON while server is running (::reloadjson)
This commit is contained in:
Ceikry
2022-07-05 13:20:55 +00:00
committed by Ryan
parent b5213c40b4
commit 7c95c0725f
13 changed files with 189 additions and 86 deletions
+3 -3
View File
@@ -41,9 +41,9 @@ interface Commands : ContentInterface {
* @param name the name of the command. Example: ::example would be just "example"
* @param privilege the rights level needed to execute the command. Options are [Privilege.STANDARD], [Privilege.MODERATOR], [Privilege.ADMIN]. Defaults to [Privilege.STANDARD]
*/
fun define(name: String, privilege: Privilege = Privilege.STANDARD, handle: (Player, Array<String>) -> Unit){
CommandMapping.register(Command(name, privilege, handle))
fun define(name: String, privilege: Privilege = Privilege.STANDARD, usage: String = "", description: String = "", handle: (Player, Array<String>) -> Unit){
CommandMapping.register(Command(name, privilege, usage, description, handle))
}
fun defineCommands()
}
}