Revert "World: specialize nearby entity updating for block updates"

This reverts commit 128eb500eb.

This breaks when entities in neighbouring chunks overlap into the
current chunk without actually being tracked by it.
Perhaps it might be worth having entities tracked by all chunks their
AABB touches in the future, so that we don't have to check padding
chunks and waste CPU time.
This commit is contained in:
Dylan K. Taylor
2023-10-14 19:43:46 +01:00
parent 128eb500eb
commit 538b698a00

View File

@ -986,11 +986,8 @@ class World implements ChunkManager{
continue;
}
}
$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();
}
foreach($this->getNearbyEntities(AxisAlignedBB::one()->offset($x, $y, $z)) as $entity){
$entity->onNearbyBlockChange();
}
$block->onNearbyBlockChange();
}