Companion

object Companion

Properties

Link copied to clipboard
private val PARENT_FIRST: Array<String>

Everything that needs a single shared identity with the game/JDK; the last entry is all other mod classes.

Link copied to clipboard
private const val V2_0: Int

Packed 2.0.0 — the 2.4.x compiler's -api-version floor.

Functions

Link copied to clipboard
private fun decideRegime(ours: Int, parent: Int): MaskingClassLoader.Regime
Link copied to clipboard
private fun isKotlinRuntime(n: String): Boolean

The kotlin RUNTIME namespace that SHARE_ALL delegates to the parent and SPLIT redirects to the game: the stdlib + reflect, NOT the compiler (org.jetbrains.kotlin.*, always masking-owned). Excludes the scripting API (kotlin.script.*) and kotlin-metadata-jvm (kotlin.metadata.*) — the game ships neither, so delegating or redirecting them would hit a loader that lacks them. They stay masking-owned via the normal child-first path.

Link copied to clipboard
private fun kotlinVersionOf(cl: ClassLoader): Int

KotlinVersion.CURRENT as seen through cl, packed into one int (major<<16 | minor<<8 | patch); -1 if that loader has no kotlin — reflective, since it is another loader's copy being asked. Used for the game's version via the parent.

Link copied to clipboard

The REPL impl (script host + template) MUST come from our urls so it links the scripting API we own; everything else that needs a single shared identity with the game/JDK goes to the parent.

Link copied to clipboard
private fun probeKotlinVersion(urls: Array<URL>): Int

C: our bundled kotlin version, packed as in kotlinVersionOf. Read through a throwaway parent=null loader over our own urls — reading it through masking would be circular, since whether masking serves our kotlin or the parent's IS the regime being decided. kotlinVersionOf answers its own failures; the close is the one thing left that can fail here, and a throwaway loader that will not close must not void the version it just read.

Link copied to clipboard
private fun verString(v: Int): String?

Packed ->"major.minor.patch" for logging; null for an absent version.