mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-05 16:49:04 +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 {
|
plugin {
|
||||||
name = "chat_commands"
|
name = "chat_commands"
|
||||||
authors = [
|
authors = [
|
||||||
"Graham",
|
"Graham",
|
||||||
"Major",
|
"Major",
|
||||||
"lare96",
|
"lare96",
|
||||||
"cubeee",
|
"cubeee",
|
||||||
]
|
]
|
||||||
dependencies = [
|
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.Position
|
||||||
import org.apollo.game.model.entity.setting.PrivilegeLevel
|
import org.apollo.game.model.entity.setting.PrivilegeLevel
|
||||||
import org.apollo.game.plugin.util.command.valid_arg_length
|
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.
|
* Sends the player's position.
|
||||||
*/
|
*/
|
||||||
on_command("pos", PrivilegeLevel.MODERATOR)
|
on_command("pos", PrivilegeLevel.MODERATOR)
|
||||||
.then { player ->
|
.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