Level: fine-tuned getCollisionCubes() a little bit

since we're getting the BBs anyway, what's the point in delegating this job to the block?
This commit is contained in:
Dylan K. Taylor 2018-05-28 17:41:12 +01:00
parent 0a9ed059d6
commit 71fdd59c4c

View File

@ -1175,9 +1175,11 @@ class Level implements ChunkManager, Metadatable{
for($x = $minX; $x <= $maxX; ++$x){
for($y = $minY; $y <= $maxY; ++$y){
$block = $this->getBlockAt($x, $y, $z);
if(!$block->canPassThrough() and $block->collidesWithBB($bb)){
if(!$block->canPassThrough()){
foreach($block->getCollisionBoxes() as $blockBB){
$collides[] = $blockBB;
if($blockBB->intersectsWith($bb)){
$collides[] = $blockBB;
}
}
}
}