player doesnt fall when he is on the world border, player is not spawning on world border if he logged in nearby it

This commit is contained in:
GameHerobrine 2022-08-05 12:47:19 +03:00
parent 431063ad83
commit 4ffa7f46a4
2 changed files with 4 additions and 2 deletions

View file

@ -1425,8 +1425,7 @@ class Player{
$pk = new SetTimePacket;
$pk->time = $this->level->getTime();
$this->dataPacket($pk);
$pos = new Position($this->data->get("position")["x"], $this->data->get("position")["y"], $this->data->get("position")["z"], $this->level);
$pos = new Position(floor($this->data->get("position")["x"]), floor($this->data->get("position")["y"]), floor($this->data->get("position")["z"]), $this->level);
$pos = $this->level->getSafeSpawn($pos);
$this->teleport($pos);
$this->server->schedule(10, [$this, "teleport"], $pos);