World: Fixed getSafeSpawn() not accepting seed positions below y=1 (#5955)

this should have been changed during the introduction of y=-64 minimum world height, but it got missed.
This commit is contained in:
jasonw_4331
2023-08-02 13:05:16 -04:00
committed by GitHub
parent 53de55dcde
commit 1a2c10e844

View File

@ -2951,7 +2951,7 @@ class World implements ChunkManager{
* @throws WorldException if the terrain is not generated
*/
public function getSafeSpawn(?Vector3 $spawn = null) : Position{
if(!($spawn instanceof Vector3) || $spawn->y < 1){
if(!($spawn instanceof Vector3) || $spawn->y <= $this->minY){
$spawn = $this->getSpawnLocation();
}