Use new features in pocketmine/math 1.0.0

This commit is contained in:
Dylan K. Taylor
2023-08-03 16:46:16 +01:00
parent c91c8c2f9e
commit 6ac45526f9
5 changed files with 44 additions and 58 deletions

View File

@ -1906,14 +1906,7 @@ class World implements ChunkManager{
unset($this->blockCollisionBoxCache[$chunkHash][$relativeBlockHash]);
//blocks like fences have collision boxes that reach into neighbouring blocks, so we need to invalidate the
//caches for those blocks as well
foreach([
[0, 0, 1],
[0, 0, -1],
[0, 1, 0],
[0, -1, 0],
[1, 0, 0],
[-1, 0, 0]
] as [$offsetX, $offsetY, $offsetZ]){
foreach(Facing::OFFSET as [$offsetX, $offsetY, $offsetZ]){
$sideChunkPosHash = World::chunkHash(($x + $offsetX) >> Chunk::COORD_BIT_SIZE, ($z + $offsetZ) >> Chunk::COORD_BIT_SIZE);
$sideChunkBlockHash = World::chunkBlockHash($x + $offsetX, $y + $offsetY, $z + $offsetZ);
unset($this->blockCollisionBoxCache[$sideChunkPosHash][$sideChunkBlockHash]);