1
0
mirror of https://github.com/pmmp/PocketMine-MP.git synced 2025-05-24 14:34:52 +00:00

Check the entity is actually inside a block before trying to shove it out, fix

This commit is contained in:
Dylan K. Taylor 2017-05-26 17:11:51 +01:00
parent 3446f68c74
commit 4c764072b2

@ -862,6 +862,10 @@ abstract class Entity extends Location implements Metadatable{
} }
protected function checkObstruction($x, $y, $z){ protected function checkObstruction($x, $y, $z){
if(count($this->level->getCollisionCubes($this, $this->getBoundingBox(), false)) === 0){
return false;
}
$i = Math::floorFloat($x); $i = Math::floorFloat($x);
$j = Math::floorFloat($y); $j = Math::floorFloat($y);
$k = Math::floorFloat($z); $k = Math::floorFloat($z);