From beb84ca0131557335af6b6d698cd2f8b16bab550 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Thu, 16 May 2013 18:11:26 +0200 Subject: [PATCH] Teleport fixes --- src/API/PlayerAPI.php | 2 +- src/Player.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/API/PlayerAPI.php b/src/API/PlayerAPI.php index b82585dec3..b4dfa9f958 100644 --- a/src/API/PlayerAPI.php +++ b/src/API/PlayerAPI.php @@ -136,7 +136,7 @@ class PlayerAPI{ if(count($params) === 3){ $spawn = new Position(floatval(array_shift($params)), floatval(array_shift($params)), floatval(array_shift($params)), $issuer->level); }else{ - $spawn = new Position($issuer->x, $issuer->y, $issuer->z, $issuer->level); + $spawn = new Position($issuer->entity->x, $issuer->entity->y, $issuer->entity->z, $issuer->entity->level); } $target->setSpawn($spawn); diff --git a/src/Player.php b/src/Player.php index ba29706706..a64b66de50 100644 --- a/src/Player.php +++ b/src/Player.php @@ -968,7 +968,6 @@ class Player{ $this->server->schedule(50, array($this, "orderChunks"), array(), true); $this->blocked = false; $this->teleport(new Position($this->data->get("position")["x"], $this->data->get("position")["y"], $this->data->get("position")["z"], $this->level)); - $this->setSpawn(new Vector3($this->data->get("spawn")["x"], $this->data->get("spawn")["y"], $this->data->get("spawn")["z"]), $this->data->get("spawn")["level"]); break; case 2://Chunk loaded? break;