@torba/cleanroom
v1.0.9
Published
[Cleanroom Loader](https://cleanroommc.com/) support for torba. Resolves a Cleanroom release on GitHub, fetches the installer JAR, reads its bundled `version.json` + `install_profile.json`, and emits all artifacts needed to run vanilla 1.12.2 + Cleanroom.
Readme
@torba/cleanroom
Cleanroom Loader support for torba. Resolves a Cleanroom release on GitHub, fetches the installer JAR, reads its bundled version.json + install_profile.json, and emits all artifacts needed to run vanilla 1.12.2 + Cleanroom.
No Mojang-controlled bytes are redistributed: vanilla artifacts come from Mojang URLs (via @torba/minecraft), Cleanroom's bundled bootstrap jar is materialized on the user's machine by extracting the maven/ tree from the installer.
Install
npm install @torba/cleanroom @torba/minecraft @torba/core zodUsage
import { resolveCleanroom } from '@torba/cleanroom';
const cr = await resolveCleanroom({ version: '0.5.9-alpha' });
cr.artifacts; // Vanilla MC + Cleanroom installer + bundled cleanroom jar + runtime libs
cr.vars; // Vars including merged classpath
cr.launch; // Assembled Launch using Foundation as the JVM main class
cr.jvmArgs; // JVM args alone (Valset)
cr.mainClass; // Foundation main class wrapped as a Val
cr.gameArgs; // Game args alone (Valset)Version input
The version field accepts:
- Exact release tag —
'0.5.9-alpha'. 'latest'— newest non-prerelease GitHub release. (Cleanroom is currently alpha-only, so this throws today; pin a tag or use'prerelease'.)'prerelease'— newest GitHub release including prereleases.
Options
resolveCleanroom({
version: string,
repo?: string, // default: 'CleanroomMC/Cleanroom'
token?: string, // optional GitHub token for higher rate limits
});How it works
- Resolves the requested
versionagainsthttps://api.github.com/repos/<repo>/releasesand picks the matching release's*-installer.jarasset. - Downloads the installer JAR once and reads
version.json+install_profile.jsondirectly out of it (no upstream metadata service needed). - Fetches the vanilla MC client for
version.json.inheritsFrom(typically1.12.2) via@torba/minecraft. - Emits artifacts for:
- vanilla MC (client.jar, libraries, asset index, assets, natives)
- the Cleanroom installer JAR with an
extract: scan('maven/', ...)rule so the bundledcleanroom-<v>.jarlands at the correct library path on first launch - the runtime libraries listed in the installer's
version.json(thecom.cleanroommc:cleanroom:<v>entry hasurl: ""and is sourced from themaven/extract instead of being downloaded) - install-time libraries from
install_profile.json(e.g.mcp_config)
- Builds the launch classpath as
client.jar + vanilla libs + Cleanroom runtime libs, sets the launchmainClasstotop.outlands.foundation.boot.Foundation, and uses Cleanroom's legacyminecraftArgumentsas the game args (replacing vanilla's, per the Mojang launcher'sinheritsFromsemantics).
Notes
- Java 25 is required — torba does not manage JVMs, so configure your launch's
command(e.g.launch: { ...cr.launch, command: '/path/to/java25/javaw' }) accordingly. - Cleanroom has no install processors, no ForgeWrapper-equivalent, and no jar-merging step. The
Foundationmain class does its own bootstrap at runtime. - The installer JAR is downloaded twice per session: once at template-build time to read its bundled JSONs, once at install time as a normal artifact. It's only ~5 MB.
- The installer's GitHub asset URL is direct — no rate limits beyond GitHub's normal CDN behavior. The release-listing API call respects
options.tokenif you need authenticated rate limits.
