This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
api:migration:neoforge [2023/11/17 04:20] – wip shedaniel | api:migration:neoforge [2024/05/11 12:37] (current) – clarify file paths in forge-like section juuz | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== NeoForge Migration ====== | ====== NeoForge Migration ====== | ||
Since an Architectury Loom 1.4 update, NeoForge 1.20.2 support has been introduced into Architectury. This page serves as a tutorial on how to migrate to NeoForge, depending on your current project, and your goals. The tutorials can be applied in reverse if needed. | Since an Architectury Loom 1.4 update, NeoForge 1.20.2 support has been introduced into Architectury. This page serves as a tutorial on how to migrate to NeoForge, depending on your current project, and your goals. The tutorials can be applied in reverse if needed. | ||
+ | |||
+ | __We assume the migration is not easy, please feel free to step by the Discord server for assistance.__ | ||
+ | |||
+ | == Acknowledgments == | ||
+ | The bulk of the work on porting Architectury Loom is done by [[https:// | ||
==== About MinecraftForge ==== | ==== About MinecraftForge ==== | ||
- | To read more about our support on MinecraftForge and NeoForge, you may read more on the [[api: | + | To learn more about our support on MinecraftForge and NeoForge, you may read on the [[api: |
+ | |||
+ | ==== About Yarn ==== | ||
+ | |||
+ | Architectury Loom had always supported Yarn as a mappings option for Forge, and will continue to do so for NeoForge. NeoForge has removed srg mappings as intermediary, | ||
+ | |||
+ | Architectury Loom 1.4 adds " | ||
+ | |||
+ | - Write ATs in Mojang Mappings | ||
+ | - Don't use JS coremods | ||
+ | - Don't use reflection to access Minecraft internals (while we have a solution to remap reflection, it is not yet in Architectury Loom because we really **really** don't want to use it) | ||
+ | - MixinExtras may not function properly if you use Yarn (We have ditched refmaps for mixins, and our remapper is currently not capable of remapping MixinExtras) | ||
===== Migrate your Forge-only project to NeoForge ===== | ===== Migrate your Forge-only project to NeoForge ===== | ||
Line 31: | Line 47: | ||
<code groovy> | <code groovy> | ||
- | neoforge | + | neoForge |
</ | </ | ||
Line 63: | Line 79: | ||
- Add a Forge-like subproject, and a NeoForge subproject | - Add a Forge-like subproject, and a NeoForge subproject | ||
- | ===== Migrate your Forge subproject to NeoForge | + | ==== Migrate your Forge subproject to NeoForge ==== |
**1. Update to latest Gradle & Architectury Loom 1.4** | **1. Update to latest Gradle & Architectury Loom 1.4** | ||
Line 88: | Line 104: | ||
<code groovy> | <code groovy> | ||
- | neoforge | + | neoForge |
</ | </ | ||
+ | |||
+ | If you are using Architectury API, make sure to change '' | ||
**6. Make sure your project' | **6. Make sure your project' | ||
Line 171: | Line 189: | ||
**10. Refresh Gradle & Run Configs, Fix Errors & forge/ | **10. Refresh Gradle & Run Configs, Fix Errors & forge/ | ||
- | ===== Add a NeoForge subproject independent of the Forge subproject | + | ==== Add a NeoForge subproject independent of the Forge subproject ==== |
**1. Initial Setup** | **1. Initial Setup** | ||
- | Create a '' | + | Create a '' |
Then in '' | Then in '' | ||
Line 183: | Line 201: | ||
Follow the steps above in " | Follow the steps above in " | ||
- | ===== Add a Forge-like subproject, and a NeoForge subproject ===== | + | Also remember, in your '' |
- | WIP | + | |
+ | <code groovy> | ||
+ | architectury { | ||
+ | common(" | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== Add a Forge-like subproject, and a NeoForge subproject ==== | ||
+ | |||
+ | **1. Initial Setup** | ||
+ | |||
+ | * Create a '' | ||
+ | * Copy your '' | ||
+ | * Copy your '' | ||
+ | * Copy your '' | ||
+ | * In '' | ||
+ | * In '' | ||
+ | |||
+ | **2. Setup NeoForge** | ||
+ | |||
+ | Follow the steps above in " | ||
+ | |||
+ | Make sure you do the " | ||
+ | |||
+ | <code groovy> | ||
+ | architectury { | ||
+ | common(" | ||
+ | it.platformPackage " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | **3. Setup Forge-Like** | ||
+ | |||
+ | In '' | ||
+ | <code groovy> | ||
+ | architectury { | ||
+ | forgeLike([" | ||
+ | it.platformPackage " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Then, remove the dependency on Fabric Loader, and add the dependency on MinecraftForge, | ||
+ | |||
+ | <code groovy> | ||
+ | dependencies { | ||
+ | forge " | ||
+ | compileOnly(project(path: | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | **4. Setup Forge** | ||
+ | |||
+ | In '' | ||
+ | |||
+ | <code groovy> | ||
+ | dependencies { | ||
+ | forge " | ||
+ | |||
+ | common(project(path: | ||
+ | common(project(path: | ||
+ | shadowCommon(project(path: | ||
+ | shadowCommon(project(path: | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | **5. Setup NeoForge** | ||
+ | |||
+ | First, we need to add the forgeLike configuration, | ||
+ | |||
+ | <code groovy> | ||
+ | configurations { | ||
+ | common | ||
+ | forgeLike | ||
+ | shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this. | ||
+ | compileClasspath.extendsFrom common, forgeLike | ||
+ | runtimeClasspath.extendsFrom common, forgeLike | ||
+ | developmentNeoForge.extendsFrom common | ||
+ | developmentForgeLike.extendsFrom forgeLike | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Then, similar to above, we will add the dependency on Forge-Like' | ||
+ | |||
+ | <code groovy> | ||
+ | dependencies { | ||
+ | neoforge " | ||
+ | |||
+ | common(project(path: | ||
+ | forgeLike(project(path: | ||
+ | shadowCommon(project(path: | ||
+ | shadowCommon(project(path: | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | **6. Setup NeoForge remaps** | ||
+ | |||
+ | Since there are class renames in NeoForge, we will want to remap them. Architectury Plugin automatically added remaps to NeoForge' | ||
+ | |||
+ | Here's an example on remapping '' | ||
+ | |||
+ | <code groovy> | ||
+ | // In forgelike/ | ||
+ | architectury { | ||
+ | forgeLike([" | ||
+ | it.platformPackage " | ||
+ | it.remapForgeLike " | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // In neoforge/ | ||
+ | architectury { | ||
+ | neoForge { | ||
+ | platformPackage | ||
+ | remapForgeLike " | ||
+ | } | ||
+ | } | ||
+ | </ |