Work on some commands
This commit is contained in:
@@ -3,7 +3,7 @@ package io.dico.parcels2.command
|
||||
import io.dico.dicore.command.CommandBuilder
|
||||
import io.dico.dicore.command.ICommandDispatcher
|
||||
import io.dico.parcels2.ParcelsPlugin
|
||||
import io.dico.parcels2.debugging
|
||||
import io.dico.parcels2.logger
|
||||
|
||||
@Suppress("UsePropertyAccessSyntax")
|
||||
fun getParcelCommands(plugin: ParcelsPlugin): ICommandDispatcher {
|
||||
@@ -11,16 +11,25 @@ fun getParcelCommands(plugin: ParcelsPlugin): ICommandDispatcher {
|
||||
return CommandBuilder()
|
||||
.addParameterType(false, ParcelParameterType(plugin.worlds))
|
||||
.addParameterType(true, ParcelHomeParameterType(plugin.worlds))
|
||||
|
||||
.group("parcel", "plot", "plots", "p")
|
||||
.registerCommands(ParcelCommands(plugin))
|
||||
.registerCommands(ParcelAddCommands(plugin))
|
||||
|
||||
.group("option")
|
||||
.apply { ParcelOptionCommands.setGroupDescription(this) }
|
||||
.registerCommands(ParcelOptionCommands(plugin))
|
||||
.parent()
|
||||
|
||||
.putDebugCommands(plugin)
|
||||
|
||||
.parent()
|
||||
.getDispatcher()
|
||||
//@formatter:on
|
||||
}
|
||||
|
||||
private fun CommandBuilder.putDebugCommands(plugin: ParcelsPlugin): CommandBuilder {
|
||||
if (!debugging) return this
|
||||
if (!logger.isDebugEnabled) return this
|
||||
//@formatter:off
|
||||
return group("debug", "d")
|
||||
.registerCommands(DebugCommands(plugin))
|
||||
|
||||
Reference in New Issue
Block a user