mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Cache fix related to #1813: Don't cache blocks for chunks that don't exist
This commit is contained in:
parent
67a576722c
commit
131a6a4d19
@ -1456,8 +1456,13 @@ class Level implements ChunkManager, Metadatable{
|
||||
$index = Level::blockHash($x, $y, $z);
|
||||
if($cached and isset($this->blockCache[$index])){
|
||||
return $this->blockCache[$index];
|
||||
}elseif(isset($this->chunks[$chunkIndex = Level::chunkHash($x >> 4, $z >> 4)])){
|
||||
$fullState = $this->chunks[$chunkIndex]->getFullBlock($x & 0x0f, $y, $z & 0x0f);
|
||||
}
|
||||
|
||||
$chunk = $this->chunks[$chunkIndex = Level::chunkHash($x >> 4, $z >> 4)] ?? null;
|
||||
if($chunk !== null){
|
||||
$fullState = $chunk->getFullBlock($x & 0x0f, $y, $z & 0x0f);
|
||||
}else{
|
||||
$addToCache = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user