SubChunkExplorer::moveTo() now returns a status

this can be used by SubChunkExplorer subclasses to implement specialized logic.
This commit is contained in:
Dylan K. Taylor
2020-10-26 16:25:21 +00:00
parent 390bc631c8
commit 31c2c3abb5
7 changed files with 63 additions and 14 deletions

View File

@ -24,6 +24,7 @@ declare(strict_types=1);
namespace pocketmine\world\light;
use pocketmine\world\utils\SubChunkExplorer;
use pocketmine\world\utils\SubChunkExplorerStatus;
use pocketmine\world\World;
use function max;
@ -59,7 +60,7 @@ class SkyLightUpdate extends LightUpdate{
}
public function recalculateNode(int $x, int $y, int $z) : void{
if(!$this->subChunkExplorer->moveTo($x, $y, $z, false)){
if($this->subChunkExplorer->moveTo($x, $y, $z, false) === SubChunkExplorerStatus::INVALID){
return;
}
$chunk = $this->subChunkExplorer->currentChunk;