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
Next revisionBoth sides next revision
tutorial:mappings [2019/06/01 18:48] – Add Remapping jamieswhiteshirttutorial:mappings [2019/10/10 18:57] – Custom mappings liach
Line 9: Line 9:
 In Loom, the mappings define the names for Minecraft classes, fields and methods used in your development environment. These names may vary from one development environment to another depending on the installed mappings. In Loom, the mappings define the names for Minecraft classes, fields and methods used in your development environment. These names may vary from one development environment to another depending on the installed mappings.
  
-Yarn is the default mapping used by Loom. Yarn gradually improves and receives new releases as contributions are accepted. Mappings in Loom are specified using the ''mappings'' dependency configuration in the buildscript and can be updated by updating the dependency. Minecraft as well as dependencies included with the ''modCompile'' dependency configuration are remapped with the mapping. Classes, fields and methods that are not mapped in Yarn are given Intermediary names like ''class_1234'', ''method_1234'' and ''field_1234''.+Yarn is the default mapping used by Loom. Yarn gradually improves and receives new releases as contributions are accepted. Mappings in Loom are specified using the ''mappings'' dependency configuration in the buildscript and can be updated by updating the dependency. Minecraft as well as dependencies included with mod-augmented dependency configurations like ''modCompile'' are remapped with the mapping. Classes, fields and methods that are not mapped in Yarn are given Intermediary names like ''class_1234'', ''method_1234'' and ''field_1234''.
  
 <code> <code>
Line 22: Line 22:
 Loom's ''remapJar'' task will produce the primary mod artifact, which is a built jar using intermediary names. 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. 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.
  
-  * **The '-dev' jar (the ''jar'' task output) does not use intermediary names, and is therefore not useful.** It cannot be installed as a mod outside a development environment and will only work in a development environment with matching mappings. The regular jar (the ''remapJar'' task output) should be used instead and installed in development environments using the ''modCompile'' dependency configuration.+  * **The '-dev' jar (the ''jar'' task output) does not use intermediary names, and is therefore not useful.** It cannot be installed as a mod outside a development environment and will only work in a development environment with matching mappings. The regular jar (the ''remapJar'' task output) should be used instead and installed in development environments using mod-augmented dependency configurations like ''modCompile''.
   * **Yarn names are only applied in a development environment**. Outside a development environment, only intermediary names exist, meaning the code will not match exactly what you see and wrote. Loom transparently handles this transition for you, but be cautious when using reflection.   * **Yarn names are only applied in a development environment**. Outside a development environment, only intermediary names exist, meaning the code will not match exactly what you see and wrote. Loom transparently handles this transition for you, but be cautious when using reflection.
 +
 +
 +=== Custom mappings ===
 +
 +You can use custom 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:
 +
 +<code>
 +dependencies {
 +    mappings fileTree(dir: "mapping", include: "**.jar")
 +}
 +</code>
 +
 +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!
  
 ==== Remapping ==== ==== Remapping ====
tutorial/mappings.txt · Last modified: 2022/05/22 08:38 by daomephsta