One shared source tree builds four targets with Stonecutter 0.10:
| Node | Minecraft | Loader | Node Java |
|---|---|---|---|
1.20.1-fabric |
1.20.1 | Fabric | 17 |
1.20.1-forge |
1.20.1 | Forge | 17 |
1.21.1-fabric |
1.21.1 | Fabric | 21 |
1.21.1-neoforge |
1.21.1 | NeoForge | 21 |
This is the default branch. The old per-version branches (1.20, 1.21) are history and are not covered by these instructions.
settings.gradle.ktsregisters the nodes andvcsVersion(the canonical committed source state,1.21.1-fabric). Every node is a flat{minecraft}-{loader}project using its loader's build script.stonecutter.gradle.ktsis the controller: the active node (stonecutter active "..."), tags and loader constants.build.fabric.gradle.kts,build.forge.gradle.kts,build.neoforge.gradle.ktsare the node build templates.stonecutter.properties.tomlholds per-loader and per-version values (mod metadata, loader versions, compatibility ranges).src/is the shared source. It always shows the active node; differences are Stonecutter comments (//? if fabric {,//? if <1.21 {).- Sources generated for the other nodes live under
versions/<node>/build/generated/stonecutter/and are disposable. Never edit them.
./gradlew projects lists nodes; ./gradlew tasks --all lists the switch tasks.
- Gradle 9.9.1 (wrapper). Stonecutter 0.10 needs Gradle 9.7+ running on Java 25.
gradle/gradle-daemon-jvm.propertiesrequests JDK 25 and the Foojay resolver downloads it when missing, so./gradlewworks from any installed JDK. Point your IDE's Gradle JVM at JDK 25.- Nodes still compile with their own Java 17/21 toolchains, provisioned the same way.
- The template defines no unit tests, GameTests or server smoke run:
./gradlew buildcompiles and packages every node andtestisNO-SOURCE.
Use --no-daemon and redirect verbose output: ./gradlew build --no-daemon > build.log 2>&1.
./gradlew build --no-daemon # every node
./gradlew ":1.20.1-forge:build" --no-daemon # one node
./gradlew "Set active project to 1.20.1-forge" --no-daemon # switch the active node
./gradlew "Reset active project" --no-daemon # back to vcsVersion; run before committingSwitch and build in separate Gradle invocations; combining them fails task validation. Switching rewrites tracked files in src/ and the active literal in stonecutter.gradle.kts, so start from a clean git status. Before committing, run Reset active project and check that git diff holds only intended changes.
- Register it in
settings.gradle.kts(for examplematch("1.21.4", "fabric", "neoforge")) and add its values tostonecutter.properties.toml(mod.mc_compat, loader and API versions) and its Java level to the build script. - Confirm
projectsandtasks --allshow the node and its switch task. - Switch to it, adapt source conditionals, build, then build every node with each node active and finish with
Reset active project.
- While it is still registered, switch to a node you keep. If it is the
vcsVersionnode, pointvcsVersionat a retained node and runReset active project; commit that churn alone. - Delete its
match(...)registration, its tables instonecutter.properties.toml, anyversions/<node>/override and any node-only build logic. - Delete source conditionals that are now constant for every remaining node.
- Check
projectslists exactly the remaining nodes, build all, run a switch round trip andReset active project:git statusmust be clean.
Edit stonecutter.properties.toml to rename the mod or update loader versions. loomx.loom_version lives in gradle.properties because the Fabric loom compatibility plugin reads it as a plain Gradle property. Forge-family scripts order createMinecraftArtifacts after stonecutterGenerate; keep that when adding access transformers. A full-file override in versions/<node>/src/ collides with the shared file while that node is active, so exclude the shared path in the build script before using one.
SirEdvin libraries and modding-buildenv are not used here. If you add them, resolve them from https://repo.repsy.io/siredvin/default, the only repository that hosts site.siredvin artifacts.