made entities spawnable in 256+/negative chunks

This commit is contained in:
GameHerobrine 2023-02-27 01:40:05 +03:00
parent 8248088c29
commit 1a9ce30f1a

View file

@ -381,7 +381,7 @@ class Entity extends Position
}
}
if($this->class !== ENTITY_PLAYER and ($this->x <= 0 or $this->z <= 0 or $this->x >= 256 or $this->z >= 256 or $this->y >= 128 or $this->y <= 0)){
if($this->class !== ENTITY_PLAYER and ($this->y >= 128 or $this->y <= 0)){
$this->close();
return false;
}
@ -576,9 +576,9 @@ class Entity extends Position
$x0 = $x0 < 0 ? 0 : $x0;
$y0 = $y0 < 0 ? 0 : $y0;
$z0 = $z0 < 0 ? 0 : $z0;
$x1 = $x1 > 256 ? 256 : $x1;
$y1 = $y1 > 128 ? 128 : $y1;
$z1 = $z1 > 256 ? 256 : $z1;
//$x1 = $x1 > 256 ? 256 : $x1;
//$y1 = $y1 > 128 ? 128 : $y1;
//$z1 = $z1 > 256 ? 256 : $z1;
for($x = $x0; $x < $x1; ++$x){
for($y = $y0; $y < $y1; ++$y){
for($z = $z0; $z < $z1; ++$z){