From 71fdd59c4c27bd947c1ff6c8a52e8c7a398c2907 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 28 May 2018 17:41:12 +0100 Subject: [PATCH] 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? --- src/pocketmine/level/Level.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index 819106933a..73146e02be 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -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; + } } } }