mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-14 17:59:41 +00:00
Check the entity is actually inside a block before trying to shove it out, fix #271
This commit is contained in:
parent
3446f68c74
commit
4c764072b2
@ -862,6 +862,10 @@ abstract class Entity extends Location implements Metadatable{
|
||||
}
|
||||
|
||||
protected function checkObstruction($x, $y, $z){
|
||||
if(count($this->level->getCollisionCubes($this, $this->getBoundingBox(), false)) === 0){
|
||||
return false;
|
||||
}
|
||||
|
||||
$i = Math::floorFloat($x);
|
||||
$j = Math::floorFloat($y);
|
||||
$k = Math::floorFloat($z);
|
||||
|
Loading…
x
Reference in New Issue
Block a user