VillageScanner 5.46.0
Finds the villages around a position (see Village) from the blocks of the loaded chunks. Sub-chunks whose palette has no POI block are skipped without reading their blocks, so a scan costs little unless there are many POIs around. Villages are built from the POIs cached by the world's PoiManager, with the beds and job sites claimed by villagers marked as such.
Constants
SCAN_HORIZONTAL
public const SCAN_HORIZONTAL = \pocketmine\world\raid\Village::BORDER_HORIZONTAL + \pocketmine\world\raid\Village::EXPANSION_HORIZONTALHorizontal and vertical reach of a scan around the position.
SCAN_VERTICAL
public const SCAN_VERTICAL = 32Methods
findBlocks()
public static function findBlocks(\pocketmine\world\World $world, int $minX, int $minY, int $minZ, int $maxX, int $maxY, int $maxZ, array $types) : arrayReturns the blocks of the given types in the loaded chunks of the box, reading only the sub-chunks whose palette has one of them.
findPoiBlocks()
public static function findPoiBlocks(\pocketmine\world\World $world, int $minX, int $minY, int $minZ, int $maxX, int $maxY, int $maxZ) : arrayReturns the POIs in the loaded chunks of the box with their block type IDs. Beds count once, at their head.
findPois()
public static function findPois(\pocketmine\world\World $world, int $minX, int $minY, int $minZ, int $maxX, int $maxY, int $maxZ) : arrayReturns the POIs in the loaded chunks of the box. Beds count once, at their head.
findVillageAt()
public static function findVillageAt(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pos) : ?\pocketmine\world\raid\VillageReturns the village nearest to the position whose boundary contains it, if any.
findVillageForOmen()
public static function findVillageForOmen(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pos) : ?\pocketmine\world\raid\VillageReturns the village whose Raid Omen region (see Village::isInOmenRange()) contains the position, if any.
findVillages()
public static function findVillages(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pos, int $horizontal = self::SCAN_HORIZONTAL, int $vertical = self::SCAN_VERTICAL) : arrayReturns the villages found around the position (scanning VillageScanner::SCAN_HORIZONTAL blocks around horizontally and VillageScanner::SCAN_VERTICAL vertically).
getPoiTypes()
public static function getPoiTypes() : array