Last active
May 5, 2019 23:45
-
-
Save ItsDoot/61360849d8f6c27f108b35b2746fb12b to your computer and use it in GitHub Desktop.
Sponge fully type-safe command api
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| object APCommand { | |
| fun register(plugin: Any) { | |
| val command = CommandRoot("ap", "aperms") { | |
| "collection" then { | |
| "list" execute ::collectionList | |
| subjectCollection("collection") then { | |
| "delete" execute executor(::collectionDelete) | |
| "info" execute executor(::collectionInfo) | |
| "subjects" execute executor(::collectionSubjects) | |
| } | |
| string("name") / "create" execute executor(::collectionCreate) | |
| } | |
| } | |
| commandManager.register(plugin, command, command.aliases.aliases) | |
| } | |
| private fun collectionList(src: CommandSource) { | |
| } | |
| private fun collectionDelete(collection: SubjectCollection, src: CommandSource) { | |
| } | |
| private fun collectionInfo(collection: SubjectCollection, src: CommandSource) { | |
| } | |
| private fun collectionSubjects(collection: SubjectCollection, src: CommandSource) { | |
| } | |
| private fun collectionCreate(name: String, src: CommandSource) { | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment