yarn/README.md

49 lines
2.7 KiB
Markdown
Raw Normal View History

2018-12-09 16:14:34 -05:00
# Yarn
2016-08-12 09:28:17 -04:00
2018-12-09 16:14:34 -05:00
Yarn is a set of open, unencumbered Minecraft mappings, free for everyone to use under the Creative Commons Zero license. The intention is to let
2016-08-14 14:44:42 -04:00
everyone mod Minecraft freely and openly, while also being able to innovate and process the mappings as they see fit.
2016-08-12 09:28:17 -04:00
To see the current version being targeted, check the branch name!
2016-08-12 09:28:52 -04:00
2019-06-19 01:08:54 -04:00
## Usage
To use yarn-deobfuscated Minecraft for Minecraft modding or as a dependency in a Java project, you can use [loom](https://github.com/fabricmc/fabric-loom) Gradle plugin. See [fabric wiki tutorial](https://fabricmc.net/wiki/tutorial:setup) for more information.
To obtain a deobfuscated Minecraft jar, [`./gradlew mapNamedJar`](#mapNamedJar) will generate a jar named like `<minecraft version>-named.jar`, which can be sent to a decompiler for deobfuscated code.
2016-08-12 09:28:17 -04:00
## Contributing
2016-08-17 17:23:55 -04:00
Please remember that copying and pasting mappings from alternate projects under more restrictive licenses (such as MCP) is **completely forbidden** without explicit permission from the
2018-12-09 06:46:48 -05:00
owners of said mappings. Discussing the naming approaches used in said projects is also not welcome - you have been warned.
2018-12-09 06:47:36 -05:00
However, it is a good idea to consult name changes with other people - use pull requests or our community spaces to ask questions!
2016-08-17 15:28:42 -04:00
Please have a look at the [naming conventions](/CONVENTIONS.md) before submitting mappings.
2016-08-17 15:28:42 -04:00
### Getting Started
2018-12-09 06:47:36 -05:00
2016-08-17 15:28:42 -04:00
1. Fork and clone the repo
2018-12-09 16:14:34 -05:00
2. Run `./gradlew yarn` (Linux, macOS) or `gradlew yarn` (Windows)
2016-08-17 15:28:42 -04:00
3. Profit
## Gradle
2018-12-09 16:14:34 -05:00
Yarn uses Gradle to provide a number of utility tasks for working with the mappings.
2016-08-17 15:28:42 -04:00
### `yarn`
[`setupYarn`](#setupYarn) and download and launch the latest version of [Enigma](https://github.com/FabricMC/Enigma) automatically configured to use the merged jar and the mappings.
Compared to launching Enigma externally, the gradle task adds a name guesser plugin that automatically map enums and a few constant field names.
### `build`
Build a GZip'd archive containing a tiny mapping between official (obfuscated), [intermediary](https://github.com/FabricMC/intermediary), and yarn names ("named") and packages enigma mappings into a zip archive..
### `mapNamedJar`
Builds a deobfuscated jar with yarn mappings and automapped fields (enums, etc.). Unmapped names will be filled with [intermediary](https://github.com/FabricMC/Intermediary) names.
2016-08-17 15:28:42 -04:00
### `download`
Downloads the client and server Minecraft jars for the current Minecraft version to `.gradle/minecraft`
### `mergeJars`
2018-12-09 16:14:34 -05:00
Merges the client and server jars into one merged jar, located at `VERSION-merged.jar` in the mappings directory where `VERSION` is the current Minecraft version.
2016-08-17 15:28:42 -04:00
2018-12-09 16:14:34 -05:00
### `setupYarn`
[`download`](#download) and [`mergeJars`](#mergeJars)