Skip to content

Commit

Permalink
release: version 3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
4drian3d committed Mar 12, 2023
1 parent 45346e5 commit 5f61cf5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ tasks {
velocityVersion(libs.versions.velocity.get())
}
shadowJar {
archiveBaseName.set(rootProject.name)
archiveClassifier.set("")
listOf(
"org.spongepowered",
"net.byteflux",
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
)
Expand Down

0 comments on commit 5f61cf5

Please sign in to comment.