From 783cca807ba785a46d3a649a627f31bad44e54cc Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Fri, 15 Dec 2023 10:08:08 +0300 Subject: [PATCH] fixed player spawning on roof --- src/Player.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Player.php b/src/Player.php index e01e3caf..21e48f24 100755 --- a/src/Player.php +++ b/src/Player.php @@ -1432,9 +1432,9 @@ class Player{ $pk->spawnX = (int) $this->spawnPosition->x; $pk->spawnY = (int) $this->spawnPosition->y; $pk->spawnZ = (int) $this->spawnPosition->z; - $pk->x = (int) $this->entity->x; - $pk->y = (int) $this->entity->y; - $pk->z = (int) $this->entity->z; + $pk->x = $this->entity->x; + $pk->y = $this->entity->y; + $pk->z = $this->entity->z; $pk->generator = $this->level->generatorType; //1 - inf, 0 - old, 2 - flat $pk->gamemode = $this->gamemode & 0x01; $pk->eid = 0; @@ -1533,6 +1533,8 @@ class Player{ //console("Current position: {$this->entity}"); $this->server->api->player->spawnAllPlayers($this); $this->server->api->player->spawnToAllPlayers($this); + $this->teleport($this->entity); + return; } if($this->isSleeping) break; if(($this->entity instanceof Entity) and $packet->messageIndex > $this->lastMovement){