tutorial:mappings
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tutorial:mappings [2019/05/28 21:20] – [Obfuscation and deobfuscation] Remove redundant "useful" jamieswhiteshirt | tutorial:mappings [2026/03/01 23:56] (current) – Status updating on mappings cassiancc | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ==== Introduction ==== | ==== Introduction ==== | ||
| - | Mappings | + | Mappings |
| ==== Using mappings ==== | ==== Using 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. | + | When using a variant of Loom that supports remapping, 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 '' |
| + | |||
| + | By changing the mappings in your development environment, | ||
| + | |||
| + | Loom's '' | ||
| + | |||
| + | * **The ' | ||
| + | * **These names are only applied in a development environment**. Outside a development environment, | ||
| + | |||
| + | === Applying Fabric' | ||
| + | |||
| + | Yarn was a community developed mapping set that was the default for Fabric users from Fabric' | ||
| < | < | ||
| Line 18: | Line 29: | ||
| </ | </ | ||
| - | By changing the mappings in your development environment, | + | === Applying Mojang's mappings |
| - | Loom's '' | + | Since 1.14, Mojang has provided its own official mappings rather than Yarn. Note that unlike Yarn, Mojang Mappings do not include paramater |
| - | * **The output of '' | + | < |
| - | * **Yarn names are only applied | + | dependencies { |
| + | [...] | ||
| + | mappings loom.officialMojangMappings() | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | Mojang's mappings come with a usable yet more restrictive license than Yarn. Use them at your own risk. | ||
| + | |||
| + | === Applying Parchment's mappings === | ||
| + | |||
| + | Users of Mojang Mappings may wish to have paramater names and Javadocs. For that purpose, third party projects like [[https:// | ||
| + | |||
| + | < | ||
| + | dependencies { | ||
| + | [...] | ||
| + | | ||
| + | | ||
| + | | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | Mojang' | ||
| + | |||
| + | |||
| + | === Applying Custom mappings === | ||
| + | |||
| + | You can use custom [[documentation: | ||
| + | |||
| + | 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 " | ||
| + | |||
| + | < | ||
| + | dependencies { | ||
| + | mappings fileTree(dir: | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | You can change the directory where you put mapping to have any custom name; just change the name in " | ||
| + | |||
| + | You can also use layered mappings to override specific mappings, see the following: | ||
| + | |||
| + | < | ||
| + | mappings loom.layered { | ||
| + | | ||
| + | | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Remapping ==== | ||
| + | |||
| + | Remapping is the process of applying mappings to code, transforming from one set of names to another. Both Java source code and compiled Java code can be remapped. It involves changing the names of references according to the mappings, as well as carefully renaming methods to preserve overrides. It does not change what the code does, although it will affect names used in [[tutorial: | ||
| + | |||
| + | [[https:// | ||
| ==== Obfuscation and deobfuscation ==== | ==== Obfuscation and deobfuscation ==== | ||
| - | Releases of Minecraft Java Edition are obfuscated jar files, which means they are compiled binaries stripped of any meaningful naming information, | + | Releases of Minecraft Java Edition |
| - | Mappings like Yarn provide | + | Mappings like Yarn provided |
| ==== Intermediary ==== | ==== Intermediary ==== | ||
| - | A property of Minecraft' | + | A property of Minecraft' |
| + | |||
| + | Java code may be compiled for one version of a library and still work with another, making the two versions of the library binary compatible. Put simply, binary compatibility is achieved if the library exposes at least the same classes with the same methods and fields with the same names. The inconsistency in Minecraft' | ||
| - | Intermediary | + | Intermediary |
| - | Being a stable mapping, Intermediary can make Minecraft's API allow binary | + | Being a stable mapping, Intermediary can make Minecraft binary |
tutorial/mappings.1559078455.txt.gz · Last modified: 2019/05/28 21:20 by jamieswhiteshirt