FlatRemapper

private class FlatRemapper(classMap: Map<String, String>, methodMap: Map<String, String>, fieldMap: Map<String, String>, val ignoreFieldDesc: Boolean, val symbols: SymbolIndex)

Immutable mapping tables + a lazily-built immutable MC hierarchy; each eval is a plain ASM ClassRemapper. Member lookups climb owner→ancestors (super first, then interfaces) and memoize. All state is immutable or a ConcurrentHashMap memo, so many lanes may remap concurrently.

Constructors

Link copied to clipboard
constructor(classMap: Map<String, String>, methodMap: Map<String, String>, fieldMap: Map<String, String>, ignoreFieldDesc: Boolean, symbols: SymbolIndex)

Types

Link copied to clipboard
private inner class MetaRewriter(sink: ClassVisitor) : ClassVisitor

Rewrites the @Metadata proto alongside the bytecode. Sits ABOVE the ClassRemapper, so the proto handed down is already in the runtime namespace: ASM remaps an annotation's Type values and nothing else, and d1/d2 are plain strings it would pass straight through — which is what left kotlin-reflect resolving mojmap classifiers no non-mojmap runtime has, degrading to ??? or throwing with the name nowhere in the message.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
private val none: Array<String>
Link copied to clipboard
private val remapper: <anonymous>
Link copied to clipboard
Link copied to clipboard
private val symbols: SymbolIndex

Functions

Link copied to clipboard
private fun directSupers(cr: ClassReader): Array<String>

cr's direct supertypes, super first then interfaces; a null super is java/lang/Object.

Link copied to clipboard

Remap every .class in input — bytecode AND @Metadata. Sidecar files (.kotlin_module etc.) ride along unchanged.

Link copied to clipboard
private fun resolve(owner: String, name: String, desc: String, table: Map<String, String>, field: Boolean): String?

owner + all ancestors, transitively; first table hit wins (see class note on why first==correct).

Link copied to clipboard
private fun rewrite(cap: MetaCapture, owner: String): Map<String, Any?>?

The rewritten @Metadata fields, or null to re-emit the original verbatim.

Link copied to clipboard
private fun supersOf(name: String): Array<String>

name's direct supertypes, cached. Three sources: the snippet's own classes, prefilled by remap; mc-symbols; and the game loader, which holds the only copy of a mod / loader type that subclasses MC. A name none of them answers has no known supers → empty.