Skip to content

Add pc tags data extracted from the vanilla server jar (1.13-26.1) - #1308

Open
Pix3lPirat3 wants to merge 1 commit into
PrismarineJS:masterfrom
Pix3lPirat3:feat/pc-tags
Open

Pix3lPirat3 wants to merge 1 commit into
PrismarineJS:masterfrom
Pix3lPirat3:feat/pc-tags

Conversation

@Pix3lPirat3

Copy link
Copy Markdown
Contributor

Add tools/js/extractPcTags.js, which reads data/minecraft/tags from the official server jar (sha1-verified from the Mojang manifest) and writes data/pc//tags.json with #tag references resolved, everything sorted and registries namespaced. Generate it for every pc release from 1.13 to 26.1; identical versions share a directory through dataPaths.

Implements the tags direction from #412 and answers the backport question (PrismarineJS/minecraft-data-generator#56, #1080): tags are plain datapack JSON inside every server jar since 1.13, so they need no generator and no mappings. tools/js/extractPcTags.js (dependency-free) reads them from the official jar - sha1-verified download from the Mojang manifest, cached in the OS temp dir — resolves #tag references, and writes data/pc/<version>/tags.json; identical versions share a directory through dataPaths, as other data does. node extractPcTags.js --all regenerates everything in about two minutes with cached jars.

Data:

27 files covering all 46 pc releases (and pre/rc aliases) from 1.13 to 26.1. Weekly snapshots are excluded because their blocks.json aliases unrelated versions. Base datapack only. Registry keys, tag keys and members are namespaced and sorted; empty registries are omitted; every registry in the jar is emitted (block, item, fluid, entity_type from 1.13, growing to twenty on 26.1 including worldgen/*).

Format follows #1194's tags_schema.json, included verbatim (by @VasilisDragon) with its one-line test.js allowlist change so CI validates the data; #1194 remains the home for the audit and schema tests, and I'll rebase onto it if it lands first. Note #1080's file uses bare registry keys in registry order and does not pass that audit; pc/1.21.8/tags.json here has identical tag and member sets to it (sorted), so it supersedes #1080.

Verification: all 46 versions pass the schema and #1194's auditTagDocument in official mode with block/item/entity_type/biome/enchantment members from each version's own data - no dangling members. npm test passes. 1.16 and 1.16.1 alias pc/1.16-rc1 because the rc precedes the release and is identical; say if a release directory is preferred.

What consumers get: mineable/* and needs_*_tool from 1.17, incorrect_for_*_tool from 1.20.5 - the data prismarine-block needs to compute dig time without materials.json (#987, #1307). Follow-ups: PrismarineJS/node-minecraft-data#457 to expose mcData.tags, then a prismarine-block digTime() that reads tags with materials.json as the pre-1.17 fallback.

Add tools/js/extractPcTags.js, which reads data/minecraft/tags from the official server jar (sha1-verified from the Mojang manifest) and writes data/pc/<version>/tags.json with #tag references resolved, everything sorted and registries namespaced. Generate it for every pc release from 1.13 to 26.1; identical versions share a directory through dataPaths.

Copy link
Copy Markdown

I checked all 46 mapped versions against the official server-jar contents using an independent extractor; the tag sets and members match. --all reproduces the committed data, and both npm test and the tag audit/schema tests from #1194 pass. The 1.16-rc1 alias also looks fine: its tag data matches both 1.16 and 1.16.1.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants