From e7c4c3b8e6c971865a31e468e87acd8fce0ce2e5 Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Fri, 9 May 2025 18:47:46 +0300 Subject: [PATCH] fixed logging off when sneaking teleporting you down 1 block --- src/Player.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Player.php b/src/Player.php index b3cb5fbc..07db541a 100755 --- a/src/Player.php +++ b/src/Player.php @@ -1704,13 +1704,13 @@ class Player{ $pk = new StartGamePacket; $pk->seed = $this->level->getSeed(); $pk->x = $this->data->get("position")["x"]; - $pk->y = $this->data->get("position")["y"]; + $pk->y = ceil($this->data->get("position")["y"]); $pk->z = $this->data->get("position")["z"]; $pk->generator = 0; $pk->gamemode = $this->gamemode & 0x01; $pk->eid = 0; $this->dataPacket($pk); - + if(($this->gamemode & 0x01) === 0x01){ $this->slot = 0; $this->hotbar = []; @@ -1734,9 +1734,9 @@ class Player{ $this->entity = $this->server->api->entity->add($this->level, ENTITY_PLAYER, 0, ["player" => $this]); $this->eid = $this->entity->eid; $this->server->query("UPDATE players SET EID = " . $this->eid . " WHERE CID = " . $this->CID . ";"); - $this->entity->x = $this->data->get("position")["x"]; - $this->entity->y = $this->data->get("position")["y"]; - $this->entity->z = $this->data->get("position")["z"]; + $this->entity->x = $pk->x; + $this->entity->y = $pk->y; + $this->entity->z = $pk->z; if(($level = $this->server->api->level->get($this->data->get("spawn")["level"])) !== false){ $this->spawnPosition = new Position($this->data->get("spawn")["x"], $this->data->get("spawn")["y"], $this->data->get("spawn")["z"], $level);