VanillaGenerator 5.46.0
Extends Generator
Vanilla (1.18+) world generator: exact terrain shape, noise caves, aquifers and biomes, following the Java 26.3 worldgen data (Bedrock shares the overworld algorithm since 1.18). This class generates the Overworld; the VanillaNetherGenerator and VanillaEndGenerator subclasses generate the other dimensions from the "nether" and "end" noise settings.
Includes the material rules (surface blocks, bedrock, deepslate, ore veins), the carvers (old-style caves and canyons), the decoration features (ores, trees, vegetation, lakes... read from the vanilla placed/configured feature data, placed like Java Edition for the same seed, see FeatureDecorator) and the structures (villages, temples, ruins... see StructureManager and STRUCTURES-PLAN.md).
Options (generator preset, ";"-separated key=value):
- data=<dir> vanilla worldgen data cache (default: <working directory>/vanilla-worldgen), filled automatically from Mojang's Java Edition data generator on first use (see VanillaDataFetcher)
- backend=auto|compiled|interpreted (auto: the native core when the server started it, else compiled)
- carvers=on|off (default on; also off when the data cache has no carver definitions)
- features=true|false (default true): decoration features
- structures=true|false (default true): structures
- structure-positions=bedrock|java (default bedrock): Bedrock's structure positions where known, or Java's
- disabled-structures=<ids> comma-separated structure or structure set ids (or patterns like village_*) not to generate, e.g. disabled-structures=mansion,minecraft:ancient_city
- decoration=native|php (default native): with the native core, the decoration features it implements are placed by it (same blocks as PHP, less CPU); php places every feature in PHP
Constants
DEFAULT_DATA_DIR
public const DEFAULT_DATA_DIR = "vanilla-worldgen"DIMENSION
public const DIMENSION = "overworld"Dimension generated by this class: the noise settings and biome source id ("overworld", "nether", "end").
RECOMMENDED_WORKER_MEMORY_LIMIT_MB
public const RECOMMENDED_WORKER_MEMORY_LIMIT_MB = 384Async worker memory limit (memory.async-worker-hard-limit, MB) recommended for vanilla worlds: a generator worker holds the three dimension generators with their feature and structure data (~175 MB) and reaches ~240 MB while generating big structures. A lower limit is only warned about, never changed.
Methods
__construct()
public function __construct(int $seed, string $preset)dataDirectory()
public static function dataDirectory(array $options) : stringgenerateChunk()
public function generateChunk(\pocketmine\world\ChunkManager $world, int $chunkX, int $chunkZ) : voidgetCarvingMask()
public function getCarvingMask(int $chunkX, int $chunkZ) : ?arrayBlocks of a recently generated chunk visited by the carvers (index ((x << 4) | z) * height + (y - minY)), or null if this generator did not generate the chunk recently.
getDecorator()
public function getDecorator() : \pocketmine\world\generator\vanilla\feature\FeatureDecoratorgetStructureManager()
public function getStructureManager() : ?\pocketmine\world\generator\vanilla\structure\StructureManagerThe structures of this generator (positions, starts, placement), or null if they are disabled (structures=false) or the data cache has no structure data.
parseOptions()
public static function parseOptions(string $preset) : arraypopulateChunk()
public function populateChunk(\pocketmine\world\ChunkManager $world, int $chunkX, int $chunkZ) : voidprepareNativeBackend()
public static function prepareNativeBackend() : voidMain thread: starts the native terrain core for the worker threads, if the server is configured to use it. Called when a vanilla world is loaded or created; does nothing after the first call.
validatePreset()
public static function validatePreset(string $preset) : ?\pocketmine\world\generator\InvalidGeneratorOptionsExceptionPreset validator for GeneratorManager (main thread): checks the options and makes sure the vanilla data is ready, fetching it automatically if needed (see VanillaDataManager).
