From 8a9e6426ca64dfb5fd595466e430a5ee9d8bb426 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Fri, 29 Mar 2013 10:56:28 +0100 Subject: [PATCH] Optional teleport yaw & pitch --- src/Player.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Player.php b/src/Player.php index 7caa7b0d..feb633d3 100644 --- a/src/Player.php +++ b/src/Player.php @@ -484,8 +484,14 @@ class Player{ )); } - public function teleport(Vector3 $pos, $yaw = 0, $pitch = 0){ + public function teleport(Vector3 $pos, $yaw = false, $pitch = false){ if($this->entity instanceof Entity){ + if($yaw === false){ + $yaw = $this->entity->yaw; + } + if($pitch === false){ + $pitch = $this->entity->yaw; + } $this->entity->fallY = false; $this->entity->fallStart = false; $this->entity->setPosition($pos->x, $pos->y, $pos->z, $yaw, $pitch);