mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 16:24:05 +00:00
Less calls!
This commit is contained in:
parent
4c30b6b8a1
commit
fe900b417e
@ -960,8 +960,8 @@ class Level implements ChunkManager, Metadatable{
|
||||
$index = Level::blockHash($pos->x, $pos->y, $pos->z);
|
||||
if($cached === true and isset($this->blockCache[$index])){
|
||||
return $this->blockCache[$index];
|
||||
}elseif($pos->y >= 0 and $pos->y < 128 and ($chunk = $this->getChunk($pos->x >> 4, $pos->z >> 4)) !== null){
|
||||
$fullState = $chunk->getFullBlock($pos->x & 0x0f, $pos->y & 0x7f, $pos->z & 0x0f);
|
||||
}elseif($pos->y >= 0 and $pos->y < 128 and isset($this->chunks[$chunkIndex = Level::chunkHash($pos->x >> 4, $pos->z >> 4)])){
|
||||
$fullState = $this->chunks[$chunkIndex]->getFullBlock($pos->x & 0x0f, $pos->y & 0x7f, $pos->z & 0x0f);
|
||||
}else{
|
||||
$fullState = 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user