SubChunkIteratorManager: assert type of subchunk to make PHPStan happy

we know this should be a SubChunk, even though it doesn't.
This commit is contained in:
Dylan K. Taylor 2019-12-04 18:26:18 +00:00
parent e35a92d8e8
commit 60154d8127

View File

@ -71,7 +71,9 @@ class SubChunkIteratorManager{
return false;
}
$this->currentSubChunk = $this->currentChunk->getSubChunk($y >> 4);
$newSubChunk = $this->currentChunk->getSubChunk($y >> 4);
assert($newSubChunk instanceof SubChunk, "chunk inside valid bounds should always be a SubChunk instance");
$this->currentSubChunk = $newSubChunk;
if($this->onSubChunkChangeFunc !== null){
($this->onSubChunkChangeFunc)();
}