AsyncStructureLocator 5.46.0
Extends StructureLocator
A StructureLocator whose searches can be slow (seconds), so /locate structure runs them off the main thread through findNearestAsync() instead of calling findNearest().
Methods
findNearestAsync()
php
public function findNearestAsync(\pocketmine\world\World $world, string $structureId, \pocketmine\math\Vector3 $from, int $radiusChunks, bool $newChunksOnly, int $timeoutSeconds, \Closure $onCompletion) : voidLike findNearest(), but the result is passed to $onCompletion later, on the main thread: the position found (or null), $failed = true if the search crashed, $timedOut = true if it gave up after $timeoutSeconds.
