SubChunkIteratorManager: added isValid()

This commit is contained in:
Dylan K. Taylor 2019-10-23 20:21:09 +01:00
parent 21e9bca64a
commit f3f9ebf312

View File

@ -85,6 +85,15 @@ class SubChunkIteratorManager{
$this->onSubChunkChangeFunc = $callback;
}
/**
* Returns whether we currently have a valid terrain pointer.
*
* @return bool
*/
public function isValid() : bool{
return $this->currentSubChunk !== null;
}
public function invalidate() : void{
$this->currentChunk = null;
$this->currentSubChunk = null;