User Tools

Site Tools


tutorial:mappings

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
tutorial:mappings [2022/05/22 08:38] – Clarify correct build task daomephstatutorial:mappings [2025/11/04 10:14] (current) – Replace link to tutorial:migratemappings with Docs link to develop/migrating-mappings gauntrecluse
Line 18: Line 18:
 </code> </code>
  
-By changing the mappings in your development environment, you can expect that names of classes, methods and fields in Minecraft and any included mods have changed, and that your code might have to be updated to reference the changed names. [[tutorial:migratemappings|This process can be partially automated]]. You will also have to run ''genSources'' to access Minecraft sources with the updated mappings.+By changing the mappings in your development environment, you can expect that names of classes, methods and fields in Minecraft and any included mods have changed, and that your code might have to be updated to reference the changed names. [[https://docs.fabricmc.net/develop/migrating-mappings|This process can be partially automated]]. You will also have to run ''genSources'' to access Minecraft sources with the updated mappings.
  
 Loom's ''remapJar'' task will produce the primary mod artifact, which is a built jar using intermediary names. However it does not perform testing or validation, ''build'' should always be used to produce JARs for end user use. Additionally, if a ''sourcesJar'' task is present, ''remapSourcesJar'' will produce a sources jar using intermediary names. These jars can be installed as mods or included in a development environment with the ''modCompile'' dependency configuration. Loom's ''remapJar'' task will produce the primary mod artifact, which is a built jar using intermediary names. However it does not perform testing or validation, ''build'' should always be used to produce JARs for end user use. Additionally, if a ''sourcesJar'' task is present, ''remapSourcesJar'' will produce a sources jar using intermediary names. These jars can be installed as mods or included in a development environment with the ''modCompile'' dependency configuration.
Line 41: Line 41:
 === Custom mappings === === Custom mappings ===
  
-You can use custom tiny mappings for Fabric Loom for your Gradle project setup.+You can use custom [[documentation:tiny2|tiny mappings]] for Fabric Loom for your Gradle project setup.
  
 For example, if you have a custom branch of yarn which you want to use for mappings, you can build yarn with "./gradlew build" command, take out the jar file in "build/libs" directory, and move it to a folder "mapping" in your Gradle project. Then, change your mappings dependency entry to: For example, if you have a custom branch of yarn which you want to use for mappings, you can build yarn with "./gradlew build" command, take out the jar file in "build/libs" directory, and move it to a folder "mapping" in your Gradle project. Then, change your mappings dependency entry to:
Line 52: Line 52:
  
 You can change the directory where you put mapping to have any custom name; just change the name in "dir" argument above. Note that Gradle build will fail if you have any other file than the mapping jar in the mapping directory! You can change the directory where you put mapping to have any custom name; just change the name in "dir" argument above. Note that Gradle build will fail if you have any other file than the mapping jar in the mapping directory!
 +
 +You can also use layered mappings to override specific mappings, see the following:
 +
 +<code>
 +mappings loom.layered {
 +   mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
 +   mappings file("override.tiny")
 +}
 +</code>
  
 ==== Remapping ==== ==== Remapping ====
tutorial/mappings.1653208728.txt.gz · Last modified: 2022/05/22 08:38 by daomephsta