RemapCacheBuilder

Masking-loader side of the first-launch remap-bundle build. Lives in repl.impl so the masking loader owns it (child-first) and it can link mapping-io + tiny-remapper, which sit ONLY on the masking urls (off the game/module path). The game-loader side (RemapCache) does version detection + network download + JSON parsing (MC's bundled Gson lives there); this side does the two operations that need those libraries, reached from ReplBridge through the shared MaskingBridge adapter.

Pipeline: pivot proguard(named<->official) and fabric intermediary(official<->intermediary) on the shared official names (mapping-io's descriptor-aware merge — overload-safe), then reverse-remap the runtime MC jar into a mojmap symbol jar (the compile classpath a production runtime otherwise lacks).

Properties

Link copied to clipboard
private const val CONSTANT_CLASS: Int = 7
Link copied to clipboard
private const val JDK_PREFIX: String

The one thing the entry set cannot answer for: the JDK is on no classpath entry to recover.

Functions

Link copied to clipboard
private fun assemble(proguard: Path, interV2: Path, out: Path)

named<->intermediary via official pivot (mapping-io merge), written as tiny v2 (src=named).

Link copied to clipboard
private fun assembleForge(joinedPath: Path, proguard: Path, out: Path)

srg<->named via obf pivot, emitting the hybrid TSRG2 forge_gradle uses: readable class names on BOTH sides (from Mojang — MCPConfig's own srg class names are obfuscated) + f_/m_ members on the left, named members on the right. mapping-io's uniform source-switch can't express that per-element hybrid, so we take classes from named and members from srg and emit TSRG2 directly (the format is trivial).

Link copied to clipboard
private fun assembleSpigot(proguard: Path, clCsrg: Path, out: Path)

Mojang proguard + BuildData's class csrg -> tiny v2 (src=named), pivoting on the obf names both sides key on. A spigot runtime is fabric's shape, not forge's: BOTH axes move. Members keep the obf names (spigot has published no -members.csrg since 1.17), so proguard alone carries that axis; classes wear spigot's OWN names — BlockPos is BlockPosition — a rename invented by spigot and derivable from no Mojang artifact, which is why the class axis needs clCsrg.

Link copied to clipboard
fun buildArtifacts(clientTxt: String, secondSource: String, runtimeMcUri: String, outMappings: String, outSymbolsDir: String)

Assemble outMappings (tiny v2, named<->intermediary) from the downloaded clientTxt (Mojang proguard)

Link copied to clipboard
fun buildForgeArtifacts(joinedTsrg: String, clientTxt: String, runtimeMcUri: String, outMappings: String, outSymbolsDir: String)

Assemble outMappings (TSRG2 srg_to_official: left=srg-hybrid right=named) from MCPConfig joinedTsrg (obf->srg) + Mojang clientTxt (named<->obf), then reverse-remap the Mixed-SRG runtimeMcUri (readable class + srg member) into <outSymbolsDir>/mc-symbols.jar (readable class + named member) for the Kotlin compiler.

Link copied to clipboard
private fun harvestClass(b: ByteArray, own: Set<String>, out: MutableSet<String>)

Add b's CONSTANT_Class references to out as dotted names, minus the JDK and anything in own. Raw constant-pool read via ASM's low-level accessors — no member/descriptor traversal.

Link copied to clipboard
private fun mergeOnObfPivot(joinedPath: Path, proguard: Path): MemoryMappingTree

Merge MCPConfig's joined.tsrg (obf ->srg, id) with Mojang's proguard (named<->obf) over their shared obf pivot, then source-switch to named. Result: named ->srg, id, obf, i.e. readable class names as the source with srg member names riding in the "srg" namespace.

Link copied to clipboard
private fun readCsrgClasses(path: Path): Map<String, String>

BuildData's class csrg: <obf> <spigot-internal-name> per line, '#' comments. Read straight into a lookup rather than through mapping-io, which would build a second tree for assembleSpigot to walk.

Link copied to clipboard
private fun reverseRemapJar(input: Path, out: Path, provider: IMappingProvider, ignoreFieldDesc: Boolean, tag: String)

Whole-tree reverse remap into the compile-only mojmap symbol jar at out; shared by the fabric and forge branches, which differ only in provider and ignoreFieldDesc (TSRG2 fields carry no descriptor) — tag labels the timing log. input is a loader view, not a file, so it is the union's whole class tree and all supers resolve internally; ignoreConflicts absorbs forge-style override divergence.

Link copied to clipboard
private fun unwrapClassRef(raw: String): String

A CONSTANT_Class entry's internal name: [[Lcom/foo/Bar; and Lcom/foo/Bar; both ->com/foo/Bar.

Link copied to clipboard
private fun writeDeps(symJar: Path)

Harvest the EXTERNAL types referenced by symJar's class SIGNATURES and write them, one dotted class name per line (sorted), to <symJar dir>/deps.txt.