Add forge-scryfall-uuid-map CLI tool for patching edition files#10937
Open
phughk wants to merge 3 commits into
Open
Add forge-scryfall-uuid-map CLI tool for patching edition files#10937phughk wants to merge 3 commits into
phughk wants to merge 3 commits into
Conversation
36173b3 to
a15ffbb
Compare
Reads a Scryfall bulk data export and writes one JSON file per card print:
cdn_uuid/{setCode}/{collectorNumber}.json -> {"en":"uuid","ja":"uuid",...}
Defaults to all_cards (~2.5 GB) so every language print is included in each
file. Pass --default-cards for a faster English-only run (~100 MB). This is
the root cause of single-language files: using default_cards only yields one
entry per card. all_cards is required for multi-language UUID maps.
Usage: java -jar forge-scryfall-uuid-map.jar --output-dir path/to/res/cdn_uuid
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
a15ffbb to
4001da1
Compare
Remove the unused parquet-floor dependency (the tool writes JSON, not Parquet) and pre-configure exec-maven-plugin with the mainClass so callers only need -Dexec.args instead of -Dexec.mainClass and the broken -- separator. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The runtime now fetches a single set file on demand and caches it locally,
so there is no need to ship ~115k individual files with the game.
Output: {outputDir}/{setCode}.json → {"cn": {"lang": "uuid", ...}, ...}
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
To use Scryfall's rate-free CDN for card images, we need a UUID for every (set, collector-number, language) combination. Those UUIDs aren't in Forge's existing data. Scryfall publishes bulk-data exports with all of them, but they need to be processed into per-set JSON files that the runtime can fetch on demand.
This tool is the offline generator — run it once (or after each Scryfall data update) to produce the files that go in the forge-extras repository.
What it does
flowchart LR A[Scryfall bulk-data\nall_cards JSON] --> B[BulkDataFetcher\ndownloads & streams] B --> C[CardStreamParser\nreads UUID + set + cn + lang] C --> D["CdnUuidJsonWriter\nwrites cdn_uuid/{set}.json"] D --> E[~1,041 set files\nready for forge-extras]Output — one JSON file per Scryfall set code:
DFCs with distinct face UUIDs store an array for the affected language.
Usage
Run from the repo root. No full Forge build required.
The default (
all_cards) includes every language variant and produces a complete multi-language UUID map.--default-cardsis faster to regenerate but only covers English — the runtime falls back to the Scryfall API for non-English cards when a UUID is absent.New module
forge-scryfall-uuid-map/— standalone Maven module, not included in the game distribution. Added to the rootpom.xmlmodules list.MainBulkDataFetcherCardStreamParserCardRecordCdnUuidJsonWriterDepends on
The output files belong in the forge-extras repository ( Card-Forge/forge-extras#33 ). The runtime code that reads them is in PR #10928 (Card-Forge/forge).