Skip to content

StructurePlacement 5.46.0 ​

abstract class · pocketmine\world\generator\vanilla\structure\placement\StructurePlacement · source

Where the structures of a structure set may start (vanilla's StructurePlacement): the placement chunks of the concrete placement, then the frequency reduction and the exclusion zone.

Constants ​

REDUCTION_DEFAULT ​

php
public const REDUCTION_DEFAULT = 0

REDUCTION_LEGACY_1 ​

php
public const REDUCTION_LEGACY_1 = 1

REDUCTION_LEGACY_2 ​

php
public const REDUCTION_LEGACY_2 = 2

REDUCTION_LEGACY_3 ​

php
public const REDUCTION_LEGACY_3 = 3

Properties ​

$exclusionChunks ​

php
public readonly int $exclusionChunks

$exclusionSet ​

php
public readonly ?string $exclusionSet

$frequency ​

php
public readonly float $frequency

$frequencyReduction ​

php
public readonly int $frequencyReduction

$locateOffset ​

php
public readonly array $locateOffset

$salt ​

php
public readonly int $salt

Methods ​

__construct() ​

php
public function __construct(int $salt, float $frequency = 1.0, int $frequencyReduction = self::REDUCTION_DEFAULT, ?string $exclusionSet = null, int $exclusionChunks = 0, array $locateOffset = [0, 0, 0])

getLocatePos() ​

php
public function getLocatePos(int $chunkX, int $chunkZ) : array

The block position /locate reports for a start chunk (StructurePlacement.getLocatePos()).

getSpacing() ​

php
abstract public function getSpacing() : int

Typical distance in chunks between two placement chunks (used to size searches).

isPlacementChunk() ​

php
abstract public function isPlacementChunk(int $seed, int $chunkX, int $chunkZ) : bool

Whether the chunk is a placement chunk of this placement (before frequency and exclusion checks).

isStructureChunk() ​

php
public function isStructureChunk(int $seed, int $chunkX, int $chunkZ, \Closure $hasStructureChunkInRange) : bool

StructurePlacement.isStructureChunk()

parseCommon() protected ​

php
protected static function parseCommon(array $json) : array

Parses the common fields of a placement ("frequency", "frequency_reduction_method", "exclusion_zone", "locate_offset").

passesFrequency() ​

php
public function passesFrequency(int $seed, int $chunkX, int $chunkZ) : bool

StructurePlacement.FrequencyReductionMethod

passesRestrictions() ​

php
public function passesRestrictions(int $seed, int $chunkX, int $chunkZ, \Closure $hasStructureChunkInRange) : bool

The frequency and exclusion zone checks of isStructureChunk(), for a known placement chunk.

placementChunksIn() ​

php
abstract public function placementChunksIn(int $seed, int $minChunkX, int $minChunkZ, int $maxChunkX, int $maxChunkZ) : array

The placement chunks inside the given chunk area (inclusive), as [chunkX, chunkZ] pairs.

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