From 2af1b2d8baff163da2bbfb839e77ab763dc7d94a Mon Sep 17 00:00:00 2001 From: Denis Istratov Date: Tue, 26 Mar 2024 10:09:12 +0300 Subject: [PATCH] 1.0.0.2 Command fixes, new extensions --- build.gradle.kts | 2 +- .../carcadex/kotlinbukkitkit/commands/Test.kt | 21 ------------------- .../commands/extensions/CommandSenderEx.kt | 5 +++++ .../commands/service/MessagesService.kt | 1 - gradle.properties | 20 +++++++++--------- 5 files changed, 16 insertions(+), 33 deletions(-) delete mode 100644 commands/src/main/kotlin/tech/carcadex/kotlinbukkitkit/commands/Test.kt create mode 100644 commands/src/main/kotlin/tech/carcadex/kotlinbukkitkit/commands/extensions/CommandSenderEx.kt diff --git a/build.gradle.kts b/build.gradle.kts index d6e1635..5e2a2ed 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,7 +6,7 @@ plugins { } group = "tech.carcadex" -version = "1.0.0.1" +version = "1.0.0.2" repositories { mavenCentral() diff --git a/commands/src/main/kotlin/tech/carcadex/kotlinbukkitkit/commands/Test.kt b/commands/src/main/kotlin/tech/carcadex/kotlinbukkitkit/commands/Test.kt deleted file mode 100644 index ca3854a..0000000 --- a/commands/src/main/kotlin/tech/carcadex/kotlinbukkitkit/commands/Test.kt +++ /dev/null @@ -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 - } -} \ No newline at end of file diff --git a/commands/src/main/kotlin/tech/carcadex/kotlinbukkitkit/commands/extensions/CommandSenderEx.kt b/commands/src/main/kotlin/tech/carcadex/kotlinbukkitkit/commands/extensions/CommandSenderEx.kt new file mode 100644 index 0000000..606f0bd --- /dev/null +++ b/commands/src/main/kotlin/tech/carcadex/kotlinbukkitkit/commands/extensions/CommandSenderEx.kt @@ -0,0 +1,5 @@ +package tech.carcadex.kotlinbukkitkit.commands.extensions + +import org.bukkit.command.CommandSender + +typealias Sender = CommandSender; \ No newline at end of file diff --git a/commands/src/main/kotlin/tech/carcadex/kotlinbukkitkit/commands/service/MessagesService.kt b/commands/src/main/kotlin/tech/carcadex/kotlinbukkitkit/commands/service/MessagesService.kt index 209f159..6793217 100644 --- a/commands/src/main/kotlin/tech/carcadex/kotlinbukkitkit/commands/service/MessagesService.kt +++ b/commands/src/main/kotlin/tech/carcadex/kotlinbukkitkit/commands/service/MessagesService.kt @@ -11,7 +11,6 @@ object MessagesService { 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-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["#not-a-number"] = { it.sendMessage("${ChatColor.RED}It is not a number") } messages["#wrong-usage"] = { it.sendMessage("${ChatColor.RED}Wrong usage of command") } diff --git a/gradle.properties b/gradle.properties index 4d8cbbe..3df5c1c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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.keyName=secret -signing.gnupg.passphrase=secret +signing.gnupg.keyName=***REMOVED*** +signing.gnupg.passphrase=***REMOVED*** -ossrhUsername=secret -ossrhPassword=secret +ossrhUsername=itzRedTea +ossrhPassword=***REMOVED*** -nexusUsername=secret -nexusPassword=secret -sonatype.stagingProfileId=secret +nexusUsername=itzRedTea +nexusPassword=***REMOVED*** +sonatype.stagingProfileId=iRedTea -password=secret +password=***REMOVED*** kotlin.code.style=official