Level: fixed logic of getCollisionBlocks() to match getCollisionCubes()

This commit is contained in:
Dylan K. Taylor 2018-05-28 17:40:05 +01:00
parent 74c0863905
commit 0a9ed059d6

View File

@ -1113,7 +1113,7 @@ 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->getId() !== 0 and $block->collidesWithBB($bb)){
if(!$block->canPassThrough() and $block->collidesWithBB($bb)){
return [$block];
}
}
@ -1124,7 +1124,7 @@ 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->getId() !== 0 and $block->collidesWithBB($bb)){
if(!$block->canPassThrough() and $block->collidesWithBB($bb)){
$collides[] = $block;
}
}