Skip to content

ConcentricRingsPlacement 5.46.0 ​

final class · pocketmine\world\generator\vanilla\structure\placement\ConcentricRingsPlacement · source

Extends StructurePlacement

Java Edition's ConcentricRingsStructurePlacement (strongholds): count positions on rings around the origin (ChunkGeneratorStructureState.generateRingPositions()), each snapped to a random preferred biome within 112 blocks.

The positions depend on the seed and the biome source, so a placement read from the data is unbound; the structure manager of each generator binds it (bind()). The biome search of a position (57x57 noise biome samples) is done lazily, only for positions that can be near the chunks asked about: every position has its own forked random, so the order does not matter.

Constants ​

MAX_SHIFT_CHUNKS ​

php
public const MAX_SHIFT_CHUNKS = 8

How far (in chunks) the biome search can move a position.

SEARCH_RADIUS ​

php
public const SEARCH_RADIUS = 112

Biome search radius in blocks (findBiomeHorizontal(..., 112, ...)).

Properties ​

$count ​

php
public readonly int $count

$distance ​

php
public readonly int $distance

$preferredBiomes ​

php
public readonly array $preferredBiomes

$spread ​

php
public readonly int $spread

Methods ​

__construct() ​

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

bind() ​

php
public function bind(int $seed, \Closure $biomeAt) : self

A copy of this placement for one generator (ChunkGeneratorStructureState.createForNormal(): the rings seed is the level seed).

fromJson() ​

php
public static function fromJson(array $json, \Closure $resolveBiomes) : self

getInitialRingPositions() ​

php
public function getInitialRingPositions() : array

Chunk positions of the ring positions before their biome search (each final position is within MAX_SHIFT_CHUNKS of it), indexed like resolveRingPosition().

getRingPositions() ​

php
public function getRingPositions() : array

Every ring position (runs all the biome searches: slow, ~0.3 s each with the PHP biome source).

getSpacing() ​

php
public function getSpacing() : int

isPlacementChunk() ​

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

placementChunksIn() ​

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

resolveRingPosition() ​

php
public function resolveRingPosition(int $index) : array

The final chunk position of one ring position (runs its biome search the first time).

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