mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 00:38:21 +00:00
Merge pull request #387 from Major-/kotlin-experiments-pos
Improve ::position command message
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
plugin {
|
||||
name = "chat_commands"
|
||||
authors = [
|
||||
"Graham",
|
||||
"Major",
|
||||
"lare96",
|
||||
"cubeee",
|
||||
"Graham",
|
||||
"Major",
|
||||
"lare96",
|
||||
"cubeee",
|
||||
]
|
||||
dependencies = [
|
||||
"util:command",
|
||||
"api",
|
||||
"util:command",
|
||||
]
|
||||
}
|
||||
@@ -2,13 +2,19 @@ import com.google.common.primitives.Ints
|
||||
import org.apollo.game.model.Position
|
||||
import org.apollo.game.model.entity.setting.PrivilegeLevel
|
||||
import org.apollo.game.plugin.util.command.valid_arg_length
|
||||
import org.apollo.game.plugins.api.component1
|
||||
import org.apollo.game.plugins.api.component2
|
||||
import org.apollo.game.plugins.api.component3
|
||||
|
||||
/**
|
||||
* Sends the player's position.
|
||||
*/
|
||||
on_command("pos", PrivilegeLevel.MODERATOR)
|
||||
.then { player ->
|
||||
player.sendMessage("You are at: ${player.position}.")
|
||||
val (x, y, z) = player.position
|
||||
val region = player.position.regionCoordinates
|
||||
|
||||
player.sendMessage("You are at: ($x, $y, $z) in region (${region.x}, ${region.y}).")
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user