MaskingClassLoader
Classloader for the REPL's Kotlin scripting stack.
It hosts the entire Kotlin scripting stack (kotlin-compiler-embeddable + scripting-* + stdlib + reflect + script-runtime) plus the REPL impl's own Kotlin classes, on a self-managed URLClassLoader that lives OFF the FML/securejarhandler module path. That is mandatory on NeoForge: putting kotlin-compiler-embeddable on the module path makes securejarhandler throw "Invalid package name: 'native' is not a Java identifier" at boot (the compiler ships a package org.jetbrains.kotlin.native.interop, and native is a Java keyword).
The compiler (org.jetbrains.kotlin.*), the shaded intellij/etc. inside compiler-embeddable, and the REPL impl classes under ...repl.impl.* are ALWAYS child-first (masking-owned). The JDK, MC, and the mod's own non-impl classes are ALWAYS parent-first so they keep a single shared identity with the game loader.
The kotlin RUNTIME (kotlin.* stdlib/reflect) is version-regime dependent
A REPL snippet must exchange kotlin objects (lambdas = Function0, Pair, Sequence, …) with the game's mods, which use the GAME loader's kotlin. If the masking loader defines its OWN copy of those classes, a snippet value is a DIFFERENT class from the mod's parameter type → LinkageError. One shared kotlin identity is the only fully-safe unification, and it needs the versions to line up — hence Regime, overridable with mcp.kotlin.regime=auto|share|split. A feature that would otherwise need a JVM agent
Because every masking-owned class is defined right here in findClass, this loader is the single door those classes' bytes come through — which makesjava.lang.instrument unnecessary for anything scoped to them. So the preload working-set capture works on a JVM launched WITHOUT -Djdk.attach.allowAttachSelf / -XX:+EnableDynamicAgentLoading: definedClassNames answers "what did this loader define?" from its own bookkeeping. The live-patch engine (Patches.onEnter/onExit) still needs the agent and still dies without those flags: it retransforms already-loaded net.minecraft.* classes on the GAME loader and injects a jar into the bootstrap loader — neither is something a classloader can do for itself.
Constructors
Types
Properties
Functions
org.jetbrains.kotlin.*, always masking-owned).KotlinVersion.CURRENT as seen through cl, packed into one int (major<<16 | minor<<8 | patch); -1 if that loader has no kotlin — reflective, so a no-kotlin game yields -1 instead of a link error."major.minor" for the snippet compiler's -api-version/-language-version in SPLIT; null in SHARE_ALL, where the two kotlins are one and no pin is needed.