NamespaceProbe

Detects, once at startup, which naming namespace the game runtime actually uses — so the REPL knows whether a compiled (mojmap-named) script must be remapped before it can link against the running MC.

Probe the runtime rather than the loader type: dev and production ship the SAME jar, and Fabric dev is mojmap while Fabric production is intermediary, so a loader-type guess would remap dev and crash it.

Probe by string, never by symbol reference: the mod's own symbol references (e.g. Blocks.class) are remapped by Loom/reobf at package time, so on Fabric production they already point at class_2246 and would always "exist" — probing nothing. A string literal is NOT remapped.

The namespace cannot change within a process, so this runs once and caches. It lives on the game loader; the masking-loaded ReplHost reaches it by parent delegation (single shared identity).

Types

Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
private const val ANCHOR_MOJMAP_CLASS: String
Link copied to clipboard
private const val ANCHOR_MOJMAP_FIELD: String
Link copied to clipboard
Link copied to clipboard
private val OBF_FIELD_NAME: Regex
Link copied to clipboard
private val SRG_FIELD_NAME: Regex

Functions

Link copied to clipboard
private fun classOrNull(name: String): Class<*>?

Load name as a live class on the loader that defines MC (no init), or null if absent.

Link copied to clipboard

The runtime naming namespace — probed once on the first call and cached for the whole process. probe() is side-effect-free and deterministic, so a first-call race just re-probes harmlessly (no lock needed).

Link copied to clipboard

True when compiled (mojmap) script bytecode must be remapped before it can link the runtime. @JvmStatic: called statically from the must-stay-Java ReplBridge.

Link copied to clipboard