mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
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:
parent
431063ad83
commit
4ffa7f46a4
2 changed files with 4 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -419,6 +419,9 @@ class Level{
|
|||
$x = (int) round($spawn->x);
|
||||
$y = (int) round($spawn->y);
|
||||
$z = (int) round($spawn->z);
|
||||
if($x < 0 || $x > 255 || $z < 0 || $z > 255){
|
||||
return new Position($x, 128, $z, $this);
|
||||
}
|
||||
for(; $y > 0; --$y){
|
||||
$v = new Vector3($x, $y, $z);
|
||||
$b = $this->getBlock($v->getSide(0));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue