We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 23492e9 commit a1f8ebaCopy full SHA for a1f8eba
core/src/main/kotlin/br/com/devsrsouza/kotlinbukkitapi/dsl/command/CommandDSL.kt
@@ -204,13 +204,13 @@ open class KCommand(name: String,
204
return super.tabComplete(sender, alias, args)
205
}
206
207
- open fun command(name: String, vararg aliases: String = arrayOf(), block: CommandMaker) {
208
- subCommands.add(KCommand(name).also {
+ open fun command(name: String, vararg aliases: String = arrayOf(), block: CommandMaker): KCommand {
+ return KCommand(name).also {
209
it.permission = this.permission
210
it.permissionMessage = this.permissionMessage
211
it.onlyInGameMessage = this.onlyInGameMessage
212
it.usageMessage = this.usageMessage
213
- }.apply(block))
+ }.apply(block).also { subCommands.add(it) }
214
215
216
open fun executor(block: ExecutorBlock) {
0 commit comments