diff --git a/src/world/World.php b/src/world/World.php index 2ff2b5b2e..965214c14 100644 --- a/src/world/World.php +++ b/src/world/World.php @@ -986,8 +986,11 @@ class World implements ChunkManager{ continue; } } - foreach($this->getNearbyEntities(AxisAlignedBB::one()->offset($x, $y, $z)) as $entity){ - $entity->onNearbyBlockChange(); + $cellAABB = AxisAlignedBB::one()->offset($x, $y, $z); + foreach($this->getChunkEntities($x >> Chunk::COORD_BIT_SIZE, $z >> Chunk::COORD_BIT_SIZE) as $entity){ + if($entity->getBoundingBox()->intersectsWith($cellAABB)){ + $entity->onNearbyBlockChange(); + } } $block->onNearbyBlockChange(); }