Less calls!

This commit is contained in:
Shoghi Cervantes 2014-12-10 02:42:02 +01:00
parent 4c30b6b8a1
commit fe900b417e

View File

@ -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;
}