diff --git a/api/src/main/kotlin/com/undefined/stellar/StellarCommand.kt b/api/src/main/kotlin/com/undefined/stellar/StellarCommand.kt index 2df0a35..478517b 100644 --- a/api/src/main/kotlin/com/undefined/stellar/StellarCommand.kt +++ b/api/src/main/kotlin/com/undefined/stellar/StellarCommand.kt @@ -12,7 +12,11 @@ val registrars = mapOf( "1.20.6" to com.undefined.stellar.v1_20_6.BrigadierCommandRegistrar ) -class StellarCommand(name: String, vararg aliases: String) : AbstractStellarCommand(name) { +class StellarCommand(name: String, description: String = "", vararg aliases: String = arrayOf()) : AbstractStellarCommand(name, description) { + + constructor(name: String, vararg aliases: String) : this(name, "", aliases = aliases) + constructor(name: String, aliases: List) : this(name, "", aliases = aliases.toTypedArray()) + init { this.aliases.addAll(aliases) } @@ -30,4 +34,5 @@ class StellarCommand(name: String, vararg aliases: String) : AbstractStellarComm return registrar.parseAndReturnCancelled(sender, input) } } + } \ No newline at end of file diff --git a/common/src/main/kotlin/com/undefined/stellar/AbstractStellarCommand.kt b/common/src/main/kotlin/com/undefined/stellar/AbstractStellarCommand.kt index 32ae9f7..d7fd6e7 100644 --- a/common/src/main/kotlin/com/undefined/stellar/AbstractStellarCommand.kt +++ b/common/src/main/kotlin/com/undefined/stellar/AbstractStellarCommand.kt @@ -15,13 +15,11 @@ import org.bukkit.entity.Player import org.bukkit.plugin.java.JavaPlugin @Suppress("UNCHECKED_CAST") -abstract class AbstractStellarCommand(val name: String) : SubCommandHandler() { +abstract class AbstractStellarCommand(val name: String, var description: String = "", var usage: String = "") : SubCommandHandler() { override fun getBase(): AbstractStellarCommand<*> = this val aliases: MutableList = mutableListOf() - var description: String = "" - var usage: String = "" val failureMessages: MutableList = mutableListOf() val globalFailureMessages: MutableList = mutableListOf() val failureExecutions: MutableList> = mutableListOf()