Possible fix for #2267, #2314

This commit is contained in:
Shoghi Cervantes 2014-11-27 13:47:17 +01:00
parent a7abd5ff9d
commit dd3207cbd8

View File

@ -1936,18 +1936,18 @@ class Level implements ChunkManager, Metadatable{
} }
if($spawn instanceof Vector3){ if($spawn instanceof Vector3){
$v = $spawn->floor(); $v = $spawn->floor();
for(; $v->y > 0; $v->y -= 2){ for(; $v->y > 0; --$v->y){
$b = $this->getBlock($v); $b = $this->getBlock($v);
if($b === null){ if($b === null){
return $spawn; return $spawn;
}elseif(!($b instanceof Air)){ }elseif($b->isSolid){
$v->y += 1; $v->y++;
break; break;
} }
} }
for(; $v->y < 128; ++$v->y){ for(; $v->y < 128; ++$v->y){
if($this->getBlock($v->getSide(1)) instanceof Air){ if(!$this->getBlock($v->getSide(1))->isSolid){
if($this->getBlock($v) instanceof Air){ if(!$this->getBlock($v)->isSolid){
return new Position($spawn->x, $v->y === Math::floorFloat($spawn->y) ? $spawn->y : $v->y, $spawn->z, $this); return new Position($spawn->x, $v->y === Math::floorFloat($spawn->y) ? $spawn->y : $v->y, $spawn->z, $this);
} }
}else{ }else{