From da446ff7f764bee653de1e14c35974433f38e8c3 Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Sun, 8 Oct 2023 20:38:17 +0300 Subject: [PATCH] added chunk coordinates to /loc --- src/API/PlayerAPI.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/API/PlayerAPI.php b/src/API/PlayerAPI.php index be2bc49b..938dda3e 100644 --- a/src/API/PlayerAPI.php +++ b/src/API/PlayerAPI.php @@ -258,7 +258,11 @@ class PlayerAPI{ $level = $issuer->entity->level->getName(); $compass = [0 => "X+", 1 => "Z+", 2 => "X-", 3 => "Z-", null => "null"]; $direction = $compass[$issuer->entity->getDirection()]; - return "Your coordinates: X: $x, Y: $y, Z: $z, world: $level.\nDirection: $direction"; + + $xChunk = $x >> 4; + $zChunk = $z >> 4; + + return "Your coordinates: X: $x ($xChunk), Y: $y, Z: $z ($zChunk), world: $level.\nDirection: $direction"; } return $output; }