Now that Gen2 is stable, I'm sure you're all itching to migrate your Gen1 mods to Gen2. Luckily we thought ahead a little bit and there's a relatively straightforward path to migrate Loom projects. However, for projects targeting Minecraft versions below 1.3 with both a client and server component, there is an extra step.
The most tedious element is updating the mappings, so we made sure the latest Feather gen1 builds are a near perfect match to the first Feather gen2 builds. This way you can let Loom's mappings migration feature do most of the work for you.
The basic premise is as follows: migrate your Gen1 project to the latest Feather gen1 builds, then update the build script for Gen2, et voila! your Gen1 project is now a Gen2 project.
Now for the more detailed step-by-step:
- Update the Gradle version of your project to 9.2+ (recommended 9.2.1 at the time of writing).
> ./gradlew wrapper --gradle-version 9.2.1If you updated from an old version, you may have to fix up your build script. - Update your project to use Loom/Ploceus 1.15. Depending on the version you updated from, you may have to fix up your build script. Check the mod template or ask in one of the mod-dev channels if you run into issues.
- Check https://ornithemc.net/develop/ for the latest Feather gen1 build. For example, for Minecraft 1.7.2 the latest gen1 Feather build is 31.
- Migrate your project to the latest Feather gen1 build using Loom's migration feature. For example, if your project targets Minecraft 1.7.2, migrate to Feather version 1.7.2+build.31.
./gradlew migrateMappings --mappings "net.ornithemc:feather:1.7.2+build.31"The migrated source will be in the./remappedSrcdirectory in your project. Back up your old source and implement the migrated source. - Update your project setup for Gen2. This mainly comes down to adding these three lines in
build.gradle:
ploceus {
setIntermediaryGeneration(2)
}If your project targets Minecraft versions between Beta 1.0 and release 1.3, and depends on Nests, Raven, and/or Sparrow, you will have to change how you declare those dependencies. For client-side projects, you must add these dependencies to the clientNests, clientExceptions, clientSignatures configurations respectively, and for server-side projects to the serverNests, serverExceptions, serverSignatures configurations.
5. Check https://ornithemc.net/develop/ (remember to select Gen2!) again and update your dependencies' versions in gradle.properties.
6. Rebuild the project and fix any errors introduced by the migration process.
If your project targets Minecraft versions between Beta 1.0 and release 1.3, and has both a client and server component, there are a few extra steps to the migration process. Gen2 makes it possible to combine the client and server components into one project, similar to how you are used to developing mods for 1.3 and above.
This process is a bit more involved, and if you are unsure how to go about it, it is recommended you start with a fresh copy of the mod template, and copy the migrated client and server projects into it.
- Start by cloning a fresh copy of the mod template.
- Switch to the gen2/fabric branch of the template, or select the gen2/fabric branch when generating a repository from the template.
- Configure the project like normal, and add any dependencies your migrated projects required.
- Update the
mod.json, again referencing your migrated projects. - Copy the source from your migrated projects over into the new project. Depending on how you structured your code, you may have similar or identical classes in both the client and server components. You'll want to either combine them or rename them so they don't conflict.
- You can even re-design elements of the mod to better take advantage of the merged development environment, but that is beyond the scope of this guide.
After this, you should have a working Gen2 port of your Gen1 mod!