public function getBlocksAround()
{
if ($this->blocksAround === null) {
$minX = Math::floorFloat($this->boundingBox->minX);
$minY = Math::floorFloat($this->boundingBox->minY);
$minZ = Math::floorFloat($this->boundingBox->minZ);
$maxX = Math::ceilFloat($this->boundingBox->maxX);
$maxY = Math::ceilFloat($this->boundingBox->maxY);
$maxZ = Math::ceilFloat($this->boundingBox->maxZ);
$this->blocksAround = [];
for ($z = $minZ; $z <= $maxZ; ++$z) {
for ($x = $minX; $x <= $maxX; ++$x) {
for ($y = $minY; $y <= $maxY; ++$y) {
$block = $this->level->getBlock($this->temporalVector->setComponents($x, $y, $z));
if ($block->hasEntityCollision()) {
$this->blocksAround[Level::blockHash($block->x, $block->y, $block->z)] = $block;
}
}
}
}
}
return $this->blocksAround;
}