Skip to content

VanillaStructureFinder 5.46.0 ​

final class · pocketmine\world\generator\vanilla\structure\VanillaStructureFinder · source

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 ​

php
public const DIMENSION_END = 2

DIMENSION_NETHER ​

php
public const DIMENSION_NETHER = 1

DIMENSION_OVERWORLD ​

php
public const DIMENSION_OVERWORLD = 0

Methods ​

__construct() ​

php
public function __construct(int $dimension)

findNearest() ​

php
public function findNearest(\pocketmine\world\World $world, string $structureId, \pocketmine\math\Vector3 $from, int $radiusChunks, bool $newChunksOnly) : ?\pocketmine\math\Vector3

findNearestAsync() ​

php
public function findNearestAsync(\pocketmine\world\World $world, string $structureId, \pocketmine\math\Vector3 $from, int $radiusChunks, bool $newChunksOnly, int $timeoutSeconds, \Closure $onCompletion) : void

getPatterns() ​

php
public function getPatterns(string $structureId) : array

The Java structure ids or patterns searched for a /locate name.

getStructureIds() ​

php
public function getStructureIds() : array

searchPatterns() ​

php
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) : ?array

The 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.

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.