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

@ -40,6 +40,7 @@ use pocketmine\math\Vector3;
use pocketmine\world\particle\HugeExplodeSeedParticle;
use pocketmine\world\sound\ExplodeSound;
use pocketmine\world\utils\SubChunkExplorer;
use pocketmine\world\utils\SubChunkExplorerStatus;
use function ceil;
use function floor;
use function mt_rand;
@ -123,7 +124,7 @@ class Explosion{
$pointerY += $shiftY;
$pointerZ += $shiftZ;
if(!$this->subChunkExplorer->moveTo($vBlockX, $vBlockY, $vBlockZ, false)){
if($this->subChunkExplorer->moveTo($vBlockX, $vBlockY, $vBlockZ, false) === SubChunkExplorerStatus::INVALID){
continue;
}