VanillaDataFetcher 5.46.0
Builds the local cache of vanilla worldgen data from Mojang's own Java Edition server, on the server owner's machine. The data is © Mojang Studios (used under the Minecraft EULA) and is never shipped with PocketMine-MP.
Pipeline (runs once per MINECRAFT_VERSION / DATA_FORMAT):
- Mojang version manifest -> version JSON (sha1-checked) -> server.jar (sha1- and size-checked).
- A Java runtime of the major version the server needs: $POCKETMINE_VANILLA_JAVA if set, otherwise a portable Eclipse Temurin JRE for this OS/architecture from api.adoptium.net (SHA-256-checked).
- Mojang's data generator: java -DbundlerMainClass=net.minecraft.data.Main -jar server.jar --server --reports
- Only
EXTRACTED_PATHSare copied into the cache, plus a compact Java block state list, the structure templates used by features (from the server jar) and GeyserMC's block mappings;STAMP_FILEis written last. Everything else (JRE, server.jar, generator output) lives in a temporary directory inside the cache directory and is deleted afterwards: the job only runs again when the target data version changes (a PocketMine-MP update), so keeping ~200 MB of runtime around for months is not worth saving a ~45 MB download.
Constants
BIOME_TREE_FILE
public const BIOME_TREE_FILE = "multi_noise_biome_tree.json"Biome search trees built from the biome parameters reports (vanilla's R-tree layout), by dimension.
DATA_FORMAT
public const DATA_FORMAT = 5Bump when EXTRACTED_PATHS or the cache layout change, to force a refetch. 2: features (feature, placed_feature, block_state_provider, processor_list), carvers, block and fluid tags, the Java block state list, the structure templates used by features and GeyserMC's block mappings. 3: loot tables and what they reference (predicates, enchantments, enchantment providers, item/enchantment/entity type, instrument tags), a compact item component list and GeyserMC's item mappings. 4: the Nether biome parameters (and their search tree). 5: structures: worldgen/structure, structure_set, template_pool, biome tags (has_structure/...) and every structure template (.nbt) of the server jar.
EXTRACTED_PATHS
public const EXTRACTED_PATHS = [
"data/minecraft/worldgen/noise",
"data/minecraft/worldgen/density_function",
"data/minecraft/worldgen/noise_settings",
"data/minecraft/worldgen/material_rule",
"data/minecraft/worldgen/material_condition",
"data/minecraft/worldgen/biome",
"data/minecraft/worldgen/multi_noise_biome_source_parameter_list",
"data/minecraft/worldgen/feat …GEYSER_DIR
public const GEYSER_DIR = "geyser"GEYSER_FILES
public const GEYSER_FILES = [
"blocks.nbt" => "e0a442e63761b9d67dbcf17fceafb449bb6e1a58c98d8c60c6ac1a3128e3a5ef",
"collisions.nbt" => "92c201bc7d9917c3d877a3b4d5112086955d978aa5b70a0aecdce13de72d4dc8",
//Bedrock item id and meta of every Java item (loot tables)
"items.json" => "89ec17a95b005e5dac170d7834a18da79952c914e8f29201f6fe9a1cdb992179",
]GEYSER_MAPPINGS_URL
public const GEYSER_MAPPINGS_URL = "https://raw.githubusercontent.com/GeyserMC/mappings/81700ab543c1f4e9f9041f58dac4154ecb0d0c8b/"Java -> Bedrock block mappings by GeyserMC (MIT, https://github.com/GeyserMC/mappings), pinned to the commit made for this MINECRAFT_VERSION: blocks.nbt (Bedrock state of every Java block state, in Java state id order) and collisions.nbt (Java collision boxes, used for the "solid" and "blocks motion" checks of features). Update the commit and the hashes together with MINECRAFT_VERSION.
JAVA_BLOCKS_FILE
public const JAVA_BLOCKS_FILE = "java_blocks.json"Compact Java block state list (ids and properties), built from the blocks report.
JAVA_ENV
public const JAVA_ENV = "POCKETMINE_VANILLA_JAVA"Optional path to a java executable (major version >= the one the server.jar needs) to skip the JRE download.
JAVA_ITEMS_FILE
public const JAVA_ITEMS_FILE = "java_items.json"Compact Java item list (max stack size, max damage, enchantability), built from the item component reports.
LOCK_FILE
public const LOCK_FILE = ".fetch.lock"MINECRAFT_VERSION
public const MINECRAFT_VERSION = "26.3"Java Edition release whose worldgen matches Bedrock 1.26.5x content (first release with dappled_forest; terrain noise and density functions identical to the data the generator was verified against).
MULTI_NOISE_DIMENSIONS
public const MULTI_NOISE_DIMENSIONS = ["overworld", "nether"]Dimensions with a multi-noise biome source: their parameters report is turned into a search tree.
STAMP_FILE
public const STAMP_FILE = "version.json"TEMPLATE_DIR
public const TEMPLATE_DIR = "data/minecraft/structure"Directory of the structure templates (.nbt) used by features, copied from the server jar.
Methods
checkPlatform()
public static function checkPlatform() : ?stringReturns why the data cannot be fetched automatically on this machine, or null if it can.
compactBlocksReport()
public static function compactBlocksReport(string $path) : arrayConverts the blocks report (7 MB) to the compact list the feature engine needs: {"blocks": [[name, firstStateId, defaultStateId, [[property, [values...]], ...]], ...]} State ids of a block are consecutive, in the order of the cartesian product of the property values with the last property varying fastest (checked here). Blocks that do not follow it get an explicit "states" list instead: [name, firstStateId, defaultStateId, properties, [[stateId, [valueIndex...]], ...]].
compactItemReports()
public static function compactItemReports(string $directory) : arrayConverts the item component reports (one file per item, ~6 MB) to the compact list the loot tables need: {"items": {id: [maxStackSize, maxDamage, enchantability]}} (0 when the item has no such component).
detectPlatform()
public static function detectPlatform() : ?arrayTemurin platform names for this machine, or null if no portable runtime is published for it.
fetch()
public static function fetch(string $root, \Closure $logger, ?\Closure $heartbeat = null) : voidRuns the whole pipeline synchronously (minutes). Thread-safe as long as each root is handled by one job.
isReady()
public static function isReady(string $root) : boolreadStamp()
public static function readStamp(string $root) : ?array