From 5f61cf5b909e4cdd00cebffb4794cd6b3f447642 Mon Sep 17 00:00:00 2001 From: Adrian Date: Sun, 12 Mar 2023 10:47:20 -0500 Subject: [PATCH] release: version 3.1.0 --- build.gradle.kts | 2 + gradle.properties | 2 +- .../command/ClientCatcherCommand.kt | 41 +++++++++---------- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index d0aaa69..83906e8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -35,6 +35,8 @@ tasks { velocityVersion(libs.versions.velocity.get()) } shadowJar { + archiveBaseName.set(rootProject.name) + archiveClassifier.set("") listOf( "org.spongepowered", "net.byteflux", diff --git a/gradle.properties b/gradle.properties index 3ba5880..505c15c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ group = io.github._4drian3d -version = 3.1.0-SNAPSHOT +version = 3.1.0 description = A simple Velocity plugin to catch the client version \ No newline at end of file diff --git a/src/main/kotlin/io/github/_4drian3d/clientcatcher/command/ClientCatcherCommand.kt b/src/main/kotlin/io/github/_4drian3d/clientcatcher/command/ClientCatcherCommand.kt index 916f9ba..c115406 100644 --- a/src/main/kotlin/io/github/_4drian3d/clientcatcher/command/ClientCatcherCommand.kt +++ b/src/main/kotlin/io/github/_4drian3d/clientcatcher/command/ClientCatcherCommand.kt @@ -36,29 +36,28 @@ fun register(manager: CommandManager, plugin: ClientCatcher) { playerArgument() .executes { ctx -> val name = getString(ctx, "player") - plugin.proxyServer.getPlayer(name) - .ifPresentOrElse({ player -> - ctx.source.sendMessage( - with(plugin.messages.command) { - if (player.modInfo.isPresent) client.withMods.asMiniMessage( - Placeholder.unparsed("player", player.username), - Placeholder.unparsed("client", player.clientBrand ?: "UNKNOWN"), - Placeholder.unparsed("mods", - player.modInfo.get().mods.joinToString(", ") { "${it.id}:${it.version}" }) - ) - else client.client.asMiniMessage( - Placeholder.unparsed("player", player.username), - Placeholder.unparsed("client", player.clientBrand ?: "UNKNOWN") - ) - } - ) - }, { - ctx.source.sendMessage( - plugin.messages.command.unknownPlayer.asMiniMessage( - Placeholder.unparsed("name", name) + plugin.proxyServer.getPlayer(name).getOrNull()?.let { player -> + ctx.source.sendMessage( + with(plugin.messages.command) { + if (player.modInfo.isPresent) client.withMods.asMiniMessage( + Placeholder.unparsed("player", player.username), + Placeholder.unparsed("client", player.clientBrand ?: "UNKNOWN"), + Placeholder.unparsed("mods", + player.modInfo.get().mods.joinToString(", ") { "${it.id}:${it.version}" }) + ) + else client.client.asMiniMessage( + Placeholder.unparsed("player", player.username), + Placeholder.unparsed("client", player.clientBrand ?: "UNKNOWN") ) + } + ) + } ?: { + ctx.source.sendMessage( + plugin.messages.command.unknownPlayer.asMiniMessage( + Placeholder.unparsed("name", name) ) - }) + ) + } Command.SINGLE_SUCCESS } )