diff --git a/src/entity/Entity.php b/src/entity/Entity.php index 69fc684a1..346f196e4 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -115,6 +115,8 @@ abstract class Entity{ /** @var Block[]|null */ protected $blocksAround; + private bool $checkBlockIntersectionsNextTick = true; + /** @var Location */ protected $location; /** @var Location */ @@ -649,7 +651,10 @@ abstract class Entity{ $hasUpdate = false; - $this->checkBlockIntersections(); + if($this->checkBlockIntersectionsNextTick){ + $this->checkBlockIntersections(); + } + $this->checkBlockIntersectionsNextTick = true; if($this->location->y <= World::Y_MIN - 16 && $this->isAlive()){ $ev = new EntityDamageEvent($this, EntityDamageEvent::CAUSE_VOID, 10); @@ -1308,6 +1313,7 @@ abstract class Entity{ } protected function checkBlockIntersections() : void{ + $this->checkBlockIntersectionsNextTick = false; $vectors = []; foreach($this->getBlocksAroundWithEntityInsideActions() as $block){