diff --git a/src/Player.php b/src/Player.php index 2eb21fd16..2e1ee4de9 100644 --- a/src/Player.php +++ b/src/Player.php @@ -887,7 +887,7 @@ class Player{ return false; } - if($pos instanceof Position and $pos->level !== $this->level){ + if($pos instanceof Position and $pos->level instanceof Level and $pos->level !== $this->level){ if($this->server->api->dhandle("player.teleport.level", array("player" => $this, "origin" => $this->level, "target" => $pos->level)) === false){ $this->entity->check = true; return false; diff --git a/src/world/Entity.php b/src/world/Entity.php index 112b6026e..1389a7f26 100644 --- a/src/world/Entity.php +++ b/src/world/Entity.php @@ -820,7 +820,7 @@ class Entity extends Position{ } public function setPosition(Vector3 $pos, $yaw = false, $pitch = false){ - if($pos instanceof Position and $this->level !== $pos->level){ + if($pos instanceof Position and $pos->level instanceof Level and $this->level !== $pos->level){ $this->level = $pos->level; $this->server->preparedSQL->entity->setLevel->reset(); $this->server->preparedSQL->entity->setLevel->clear();