From c1a451f3b1a671206ecc1edfb87f73612ca3a540 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 31 Oct 2020 23:46:27 +0000 Subject: [PATCH] SubChunkExplorer: ditch subChunkChangeFunc this is better implemented by checking the moveTo() result, which also won't have circular dependencies. --- src/world/utils/SubChunkExplorer.php | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/world/utils/SubChunkExplorer.php b/src/world/utils/SubChunkExplorer.php index 44d2c20f6..80fb4b384 100644 --- a/src/world/utils/SubChunkExplorer.php +++ b/src/world/utils/SubChunkExplorer.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace pocketmine\world\utils; -use pocketmine\utils\Utils; use pocketmine\world\ChunkManager; use pocketmine\world\format\Chunk; use pocketmine\world\format\SubChunk; @@ -44,12 +43,6 @@ class SubChunkExplorer{ /** @var int */ protected $currentZ; - /** - * @var \Closure|null - * @phpstan-var (\Closure() : void)|null - */ - private $onSubChunkChangeFunc = null; - public function __construct(ChunkManager $world){ $this->world = $world; } @@ -78,9 +71,6 @@ class SubChunkExplorer{ } $this->currentSubChunk = $this->currentChunk->getSubChunk($y >> 4); - if($this->onSubChunkChangeFunc !== null){ - ($this->onSubChunkChangeFunc)(); - } return SubChunkExplorerStatus::MOVED; } @@ -95,14 +85,6 @@ class SubChunkExplorer{ return $this->moveTo($chunkX << 4, $chunkY << 4, $chunkZ << 4); } - /** - * @phpstan-param \Closure() : void $callback - */ - public function onSubChunkChange(\Closure $callback) : void{ - Utils::validateCallableSignature(function() : void{}, $callback); - $this->onSubChunkChangeFunc = $callback; - } - /** * Returns whether we currently have a valid terrain pointer. */