VanillaStructureFinder 5.46.0
Implements AsyncStructureLocator
The /locate structure locator of vanilla worlds (registered for the generators "vanilla", "vanilla_nether" and "vanilla_end"): a thin adapter over VanillaStructureLocator. It accepts the Bedrock /locate names ("village", "temple", "ruins", "monument"...), their older spellings without underscores ("endcity") and the Java structure ids ("village_plains", "jungle_pyramid", "ocean_ruin_cold"...), plus a few common English names ("woodland_mansion", "ocean_monument", "nether_fortress", "bastion").
Searches can take seconds (each candidate start needs the terrain height of its area), so /locate runs them on the /locate worker through findNearestAsync().
Constants
DIMENSION_END
public const DIMENSION_END = 2DIMENSION_NETHER
public const DIMENSION_NETHER = 1DIMENSION_OVERWORLD
public const DIMENSION_OVERWORLD = 0Methods
__construct()
public function __construct(int $dimension)findNearest()
public function findNearest(\pocketmine\world\World $world, string $structureId, \pocketmine\math\Vector3 $from, int $radiusChunks, bool $newChunksOnly) : ?\pocketmine\math\Vector3findNearestAsync()
public function findNearestAsync(\pocketmine\world\World $world, string $structureId, \pocketmine\math\Vector3 $from, int $radiusChunks, bool $newChunksOnly, int $timeoutSeconds, \Closure $onCompletion) : voidgetPatterns()
public function getPatterns(string $structureId) : arrayThe Java structure ids or patterns searched for a /locate name.
getStructureIds()
public function getStructureIds() : arraysearchPatterns()
public static function searchPatterns(\pocketmine\world\generator\vanilla\structure\StructureManager $manager, array $patterns, int $x, int $z, int $radiusChunks, ?\Closure $accept = null, ?int $deadlineNs = null) : ?arrayThe nearest start matching any of the patterns: [structure id, start chunk x, start chunk z, x, y, z] or null. Once a pattern found a start, the next patterns are only searched up to that distance.
