Command fixes, new extensions
This commit is contained in:
redtea committed 2024-03-26 10:09:12 +03:00
1 parent 050b1a5344
commit 2af1b2d8ba
5 files changed
+16 -33

No files matched your search

+1 -1
View File
@@ -6,7 +6,7 @@ plugins {
} }
group = "tech.carcadex" group = "tech.carcadex"
version = "1.0.0.1" version = "1.0.0.2"
repositories { repositories {
mavenCentral() mavenCentral()
@@ -1,21 +0,0 @@
package tech.carcadex.kotlinbukkitkit.commands
import tech.carcadex.kotlinbukkitkit.architecture.KotlinPlugin
import tech.carcadex.kotlinbukkitkit.commands.dsl.builder.simpleCommand
fun KotlinPlugin.onEnable() {
simpleCommand(
name = "test",
permission = "test.use",
tabComplete = listOf("subcmd1", "subcmd2")
) {
sender.sendMessage("test")
val arg1 = argument(0) //getting 1 argument of command as nullable string
//also you can use stringOrNull
val arg2 = string(1) //getting 1 argument of command as string
val arg3 = integer(2) //getting 2 argument of command as integer
//also you can use integerOrNull
val arg4 = double(3) //getting 3 argument of command as integer
//also you can use doubleOrNull
}
}
@@ -0,0 +1,5 @@
package tech.carcadex.kotlinbukkitkit.commands.extensions
import org.bukkit.command.CommandSender
typealias Sender = CommandSender;
@@ -11,7 +11,6 @@ object MessagesService {
messages["#no-such-player"] = { it.sendMessage("${ChatColor.RED}No such player was found") } messages["#no-such-player"] = { it.sendMessage("${ChatColor.RED}No such player was found") }
messages["#no-such-world"] = { it.sendMessage("${ChatColor.RED}No such world was found") } messages["#no-such-world"] = { it.sendMessage("${ChatColor.RED}No such world was found") }
messages["#no-such-material"] = { it.sendMessage("${ChatColor.RED}No such material was found") } messages["#no-such-material"] = { it.sendMessage("${ChatColor.RED}No such material was found") }
messages["#no-such-world"] = { it.sendMessage("${ChatColor.RED}No such world was found") }
messages["#no-such-enum"] = { it.sendMessage("${ChatColor.RED}No such value for this enum was found") } messages["#no-such-enum"] = { it.sendMessage("${ChatColor.RED}No such value for this enum was found") }
messages["#not-a-number"] = { it.sendMessage("${ChatColor.RED}It is not a number") } messages["#not-a-number"] = { it.sendMessage("${ChatColor.RED}It is not a number") }
messages["#wrong-usage"] = { it.sendMessage("${ChatColor.RED}Wrong usage of command") } messages["#wrong-usage"] = { it.sendMessage("${ChatColor.RED}Wrong usage of command") }
+10 -10
View File
@@ -1,18 +1,18 @@
version=lastest version=1.0.0.2
signing.gnupg.executable=gpg.exe signing.gnupg.executable=***REMOVED***
signing.gnupg.useLegacyGpg=false signing.gnupg.useLegacyGpg=false
signing.gnupg.keyName=secret signing.gnupg.keyName=***REMOVED***
signing.gnupg.passphrase=secret signing.gnupg.passphrase=***REMOVED***
ossrhUsername=secret ossrhUsername=itzRedTea
ossrhPassword=secret ossrhPassword=***REMOVED***
nexusUsername=secret nexusUsername=itzRedTea
nexusPassword=secret nexusPassword=***REMOVED***
sonatype.stagingProfileId=secret sonatype.stagingProfileId=iRedTea
password=secret password=***REMOVED***
kotlin.code.style=official kotlin.code.style=official