NeoForm provides steps to create reproducible and recompilable Minecraft source code.
Release versions of Minecraft are on the main
branch.
Development versions (snapshots, pre-releases) of Minecraft for an upcoming release version of Minecraft
will be on a branch named <version>-dev
to avoid bloating the main
branch. For example, 1.21.9-dev
for the snapshots and pre-releases leading up to 1.21.9.
NeoForm has two hierarchies of Gradle projects:
- There is an outer Gradle build with many subprojects: mostly one per Minecraft version.
- There is an inner Gradle build for each Minecraft version, that is generated by the outer Gradle build when wanting to create or modify source patches for a version.
A typical workflow to change the patches would be:
- Run
gradlew :<version>:projectApplyAll
in the root directly (for example replace<version>
by 1.21.8). This will run the outer Gradle build, to create a project with decompiled Minecraft sources inversions/release/<version>/projects
. - Open the generated inner build at
versions/release/<version>/projects
, for example with IntelliJ. - Make any changes to the sources of each subproject, for example change
joined/src/main/java/
in the inner build. - Run
gradlew :<version>:projectMakeAll
in the root directory to update the patches. This will run the outer Gradle build, to generate patches from the changes you made in the inner build.
type
can be eitherrelease
(release versions)pre
(pre-releases and release candidates)snapshot
(snapshots)
ver
is a major version of Minecraft without the ending.<minor_version>
(e.g. the value for 1.21.1 is 1.21)version
is a specific version of Minecraft
Options in local.properties
can be set to filter for which versions are loaded by the (outer) Gradle build:
type
(defaults torelease
)ver
(defaults to all major versions)
:<version>:projectApplyAll
- Creates Minecraft source code of that version with patches applied:<version>:projectMakeAll
- Generates patches for the specified versionupdate
- Requiresold_version
andnew_version
to be specified ingradle.properties
in the format of<type>/<ver>/<version>
. Sets up the new version based on the old version without the patches from the old version:<version>:testJdks
- Checks that the generated source code is consistant across java versions along with compilation
Some workflows need to know which release-version the current series of snapshots will result in.
We set the GitHub Actions variable TARGET_MC_VERSION
for this purpose in the project settings.
If we suspect that the current series of snapshots will be released as Minecraft 1.21.2 for example, this variable should be set to 1.21.2
.
Check For New Snapshots
- Runs every 30 minutes from 6am to 7pm UTC and checks for when Mojang releases a new version and runs theUpdate
workflowUpdate
- Runs theupdate
task and checks for any library updates along with copying over the patches from the old version to the new version then attempts to run theCheck
workflow. Parameters:Old branch
- The branch name where the old version isOld version
-<type>/<ver>/<version>
of the old versionPatches version
(deprecated) -<type>/<ver>/<version>
of the version to take the patches from (defaults toOld version
)New branch
- The branch name of where the new version will be (defaults toOld branch
)New version
-<type>/<ver>/<version>
of the new versionFix known error(s) in mapping file
(deprecated) - Was used for when Jammer would generate incorrect names for fields or methodsCopy extras
- When changing branches copy over files outside of theversions
and.github
directoriesPublish
- Passed toCheck
workflow
Check
- Required to run from the branch with the version being checked and checks if patches successfully apply and runs:<version>:testJdks
and optionally publishes to the NeoForge maven. Parameters:Version
-<type>/<ver>/<version>
of the versionPush changed patches
- If enabled and running:<version>:projectApplyAll
then:<version>:projectMakeAll
changes patches then it pushes the updated patchesPublish
whether to publish to the NeoForge maven
This project uses the obfuscation logs provided by Mojang for Minecraft in order to generate its data. That means that the data here could be considered a derivative work of those mappings. So you should be fully versed in the license associated with those official mappings. You can read more about our interpretation of them here.