Hello everyone, it's been a while. Forge now uses official Mojang mappings, and so should you if you wish to bring your Forge codebase to Fabric. Nevertheless, this tool should work, but I won't be updating it.
A Forge specific Gradle plugin to remap its sources to Yarn.
If your project is using any version of ForgeGradle 3, make sure to switch to the FG_3.0
tag.
Although the following says Yarn, you can use anything but Mojang mappings as long as it is usable by fabric-loom
- Clone this repo
- In the target project's build.gradle add the following repositories to the buildscript block
maven { url = uri("https://oss.sonatype.org/content/groups/public/") } maven { url = uri("https://maven.fabricmc.net/") }
- In the target project's build.gradle add the following to the buildscript dependencies
classpath("me.ramidzkh:yarnforge-plugin")
- Apply the
yarnforge-plugin
plugin after Forge's plugin is appliedapply(plugin: "yarnforge-plugin")
./gradlew --include-build <location to where you cloned yarnforge> userRemapYarn --mappings net.fabricmc:yarn:<yarn version> --mc-version <mc version> --no-daemon
- Add
--mixin
for Mixin support - Make sure at least 1GB of RAM has been assigned to gradle. This should have been done by default already.
--no-daemon
is extremely important or gradle will leak memory until you rundaemon --stop
!
Usage for Forge itself (as in https://github.com/MinecraftForge/MinecraftForge)
./gradlew --include-build <location to where you cloned yarnforge> clean setup forgeRemapYarn --mappings net.fabricmc:yarn:<yarn version> --mc-version <mc version> --no-daemon
- Assign at least 3GB of RAM to Gradle. If you're starved for RAM, 2GB will usually work but will be slightly slower.
- Add
--skip-clean
to skip remapping the clean source set --no-daemon
is extremely important or gradle will leak over a gig of memory until you rundaemon --stop
!- The
remapped/clean
andremapped/patched
directories contain Minecraft code, so be careful of publishing those
Apache 2.0