Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
api:migration:neoforge [2023/11/17 04:55] shedanielapi:migration:neoforge [2024/05/11 12:37] (current) – clarify file paths in forge-like section juuz
Line 5: Line 5:
  
 == Acknowledgments == == Acknowledgments ==
-The bunk of the work on porting Architectury Loom is done by [[https://github.com/Juuxel|@Juuxel]].+The bulk of the work on porting Architectury Loom is done by [[https://github.com/Juuxel|@Juuxel]].
  
 ==== About MinecraftForge ==== ==== About MinecraftForge ====
  
-To read more about our support on MinecraftForge and NeoForge, you may read more on the [[api:migration:version_10|migration page for 1.20.2]]. To summerize, we will continue to provide support for MinecraftForge and NeoForge's **toolchain** for the forseeable future. For Architectury API, we will prioritize compatibility for NeoForge over MinecraftForge in situations where it is impossible to maintain compatibility for both.+To learn more about our support on MinecraftForge and NeoForge, you may read on the [[api:migration:version_10|migration page for 1.20.2]]. To summerize, we will continue to provide support for MinecraftForge and NeoForge's **toolchain** for the forseeable future. For Architectury API, we will prioritize compatibility for NeoForge over MinecraftForge in situations where it is impossible to maintain compatibility for both.
  
 ==== About Yarn ==== ==== About Yarn ====
Line 15: Line 15:
 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, such that both the development environment and production environment both use the same mappings.  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, such that both the development environment and production environment both use the same mappings. 
  
-Architectury Loom 1.4 adds "hopes" and "prayers" (a joke, it is not actually that bad) to NeoForge in order to support Yarn. Remapping may not be done perfectly, so here's a few things to take note.+Architectury Loom 1.4 adds "hopes" and "prayers" (a joke, it is not actually that bad) to NeoForge in order to support Yarn. Remapping may not be done perfectly, so here are some things to take note.
  
   - Write ATs in Mojang Mappings   - Write ATs in Mojang Mappings
Line 200: Line 200:
  
 Follow the steps above in "Migrate your Forge subproject to NeoForge", but make sure you are applying to the ''neoforge'' project instead of the ''forge'' project. Follow the steps above in "Migrate your Forge subproject to NeoForge", but make sure you are applying to the ''neoforge'' project instead of the ''forge'' project.
 +
 +Also remember, in your ''common/build.gradle'', we want all three loaders in ''common()''.
 +
 +<code groovy>
 +architectury {
 +  common("fabric", "forge", "neoforge")
 +}
 +</code>
  
 ==== Add a Forge-like subproject, and a NeoForge subproject ==== ==== Add a Forge-like subproject, and a NeoForge subproject ====
Line 216: Line 224:
 Follow the steps above in "Migrate your Forge subproject to NeoForge", but make sure you are applying to the ''neoforge'' project instead of the ''forge'' project. Follow the steps above in "Migrate your Forge subproject to NeoForge", but make sure you are applying to the ''neoforge'' project instead of the ''forge'' project.
  
-Make sure you do the "optional" platformPackage step, you most likely want to share packages between both.+Make sure you do the "optional" platformPackage step, you most likely want to share packages between both. Also remember, in your ''common/build.gradle'', we want all three loaders in ''common()''
 + 
 +<code groovy> 
 +architectury { 
 +  common("fabric", "forge", "neoforge") { 
 +    it.platformPackage "neoforge", "forge" 
 +  } 
 +
 +</code> 
 + 
  
 **3. Setup Forge-Like** **3. Setup Forge-Like**
  
-Replace ''common()'' with ''forgeLike()'', and also apply ''platformPackage''.+In ''forgelike/build.gradle'', replace ''common()'' with ''forgeLike()'', and also apply ''platformPackage''.
 <code groovy> <code groovy>
 architectury { architectury {
Line 240: Line 258:
 **4. Setup Forge** **4. Setup Forge**
  
-Add dependency to the forge-like project, the syntax should be equal to any other common projects.+In ''forge/build.gradle'', add dependency to the forge-like project, the syntax should be equal to any other common projects.
  
 <code groovy> <code groovy>
Line 289: Line 307:
  
 <code groovy> <code groovy>
 +// In forgelike/build.gradle
 +architectury {
 +  forgeLike(["forge", "neoforge"]) {
 +    it.platformPackage "neoforge", "forge"
 +    it.remapForgeLike "net/minecraftforge/common/extensions/IForgeItem", "net/neoforged/neoforge/common/extensions/IItemExtension"
 +  }
 +}
 +
 +// In neoforge/build.gradle
 architectury { architectury {
   neoForge {   neoForge {