Yet Another Command API (tm)
Features:
- Fully type-safe.
- Easily intermingle subcommands and arguments.
- Write arguments and subcommands that are dependent on previous arguments.
- Compact Kotlin-based DSL makes writing commands simple.
import frontier.skpc.CommandTree
import frontier.skpc.util.*
import frontier.skpc.value.standard.ValueParameters.int
import org.spongepowered.api.Sponge
import org.spongepowered.api.command.CommandResult
import org.spongepowered.api.text.Text
val command = CommandTree.Root("sum").apply {
int("value1") / int("value2") execute { (value1, value2, src) ->
src.sendMessage(Text.of("$value1 + $value2 = ${value1 + value2}"))
CommandResult.success()
}
}
Sponge.getCommandManager().register(plugin, command.toCallable(), command.aliases)
arven-core shades SKPC so you don't have to!
Simply put arven-core
as a dependency in your @Plugin annotation, and have users download it when downloading your plugin.
repositories {
maven {
setUrl("https://jitpack.io")
}
}
dependencies {
implementation("com.github.Arvenwood:arven-core:<current version>")
}
repositories {
maven {
setUrl("https://jitpack.io")
}
}
dependencies {
implementation("com.github.TheFrontier:SKPC:<current version>")
}