MaskingBridge

interface MaskingBridge

Type-safe gateway across the game-loader ↔ masking-loader boundary. Aggregates every operation that can ONLY run on the masking loader — the Kotlin REPL host (repl.impl.ReplHost) and the remap-cache builder (repl.impl.RemapCacheBuilder) — behind one interface, so the game loader never has to reflect a masking-only class per call. Every method below forwards to one of those two backends; see ReplBridge for the boundary rules, which is what keeps every type here java.* or the mod's own, and how the single implementation instance is obtained.

The compile handle stays Any because its real type (kotlin.script...ResultWithDiagnostics) exists only on the masking loader; execute returns exec.Outcome or exec.IterEval, which share no common supertype, so it is Any too.

Inheritors

Functions

Link copied to clipboard
abstract fun assembleMappings(clientTxt: String, secondSource: String, outMappings: String)

Assemble the remap mappings, the MC-version half of the bundle. See ReplBridge.assembleMappings for the argument contract.

Link copied to clipboard
abstract fun buildCompiler(cpFiles: List<File>)

Build the Kotlin compiler state (overlay + createState).

Link copied to clipboard
abstract fun buildSymbols(runtimeMcUri: String, mappings: String, outSymbolsDir: String)

Reverse-remap runtimeMcUri through cached mappings into a mojmap symbol jar, the loader half. See ReplBridge.buildSymbols for the argument contract.

Link copied to clipboard
abstract fun compile(code: String, cpFiles: List<File>, guardLane: GuardLane?, evalId: Int, abandoned: BooleanSupplier): Any

Compile a snippet to an opaque handle. The handle is a masking-only type, so it is only ever passed back to execute.

Link copied to clipboard
abstract fun execute(handle: Any?, code: String, out: Capture): Any

Run a compiled handle.

Link copied to clipboard
abstract fun preload()

Load the compiler working set, or settle on a training launch where there is none to load.

Link copied to clipboard
abstract fun recordWorkingSet(path: String)

On a training launch, write the classes the masking loader has defined so far to path, plus a stamp of the kotlin version they were recorded under; preload reads it back next launch. A no-op on any other launch.

Link copied to clipboard
abstract fun warm()

Compile and run one dummy snippet, warming the whole eval path.