Added basic support for blocks with multiple AABBs, fixed stairs (#1303)

This commit is contained in:
Dylan K. Taylor
2017-10-12 16:29:24 +01:00
committed by GitHub
parent 0c092a7ceb
commit 15d6fd86e2
5 changed files with 127 additions and 119 deletions

View File

@ -1497,9 +1497,7 @@ abstract class Entity extends Location implements Metadatable{
public function isInsideOfSolid() : bool{
$block = $this->level->getBlock($this->temporalVector->setComponents(Math::floorFloat($this->x), Math::floorFloat($y = ($this->y + $this->getEyeHeight())), Math::floorFloat($this->z)));
$bb = $block->getBoundingBox();
return $bb !== null and $block->isSolid() and !$block->isTransparent() and $bb->intersectsWith($this->getBoundingBox());
return $block->isSolid() and !$block->isTransparent() and $block->collidesWithBB($this->getBoundingBox());
}
public function fastMove(float $dx, float $dy, float $dz) : bool{