diff options
| author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-26 13:40:32 +0200 |
|---|---|---|
| committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-26 13:40:32 +0200 |
| commit | 8c5cc006c8a94555ac8ff1ba159465cb6755e6cd (patch) | |
| tree | a457219879c808b7e1b12cc0156ff94bf8adeefb /src/main/java/at/hannibal2/skyhanni/features/commands | |
| parent | c9080139998fadd90286d42292e69b99e2ec942a (diff) | |
| download | skyhanni-8c5cc006c8a94555ac8ff1ba159465cb6755e6cd.tar.gz skyhanni-8c5cc006c8a94555ac8ff1ba159465cb6755e6cd.tar.bz2 skyhanni-8c5cc006c8a94555ac8ff1ba159465cb6755e6cd.zip | |
add support for sendcoords with description
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/commands')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/commands/SendCoordinatedCommand.kt | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/SendCoordinatedCommand.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/SendCoordinatedCommand.kt index c9055976a..8cc303fcf 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/commands/SendCoordinatedCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/commands/SendCoordinatedCommand.kt @@ -15,14 +15,22 @@ class SendCoordinatedCommand { val message = packet.message.lowercase() if (message == "/sendcoords") { event.isCanceled = true - val location = LocationUtils.playerLocation() - val x = location.x.toInt() - val y = location.y.toInt() - val z = location.z.toInt() - LorenzUtils.sendMessageToServer("x: $x, y: $y, z: $z") + LorenzUtils.sendMessageToServer(getCoordinates()) + } else if (message.startsWith("/sendcoords ")) { + event.isCanceled = true + val description = message.split(" ").drop(1).joinToString(" ") + LorenzUtils.sendMessageToServer("${getCoordinates()} $description") } } } + private fun getCoordinates(): String { + val location = LocationUtils.playerLocation() + val x = location.x.toInt() + val y = location.y.toInt() + val z = location.z.toInt() + return "x: $x, y: $y, z: $z" + } + }
\ No newline at end of file |
