User Tools

Site Tools


tutorial:updating_yarn

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:updating_yarn [2019/09/01 18:23] modmuss50tutorial:updating_yarn [2022/08/02 10:03] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== Updating Yarn to a new Minecraft version ======+====== Updating Yarn and intermediary to a new Minecraft version ======
  
-Accurate as of 1.14.3-pre2 / 7th June 2019+Last updated 2020-05-20 by 2Xsaiko.
  
 ===== Definitions/Notes ===== ===== Definitions/Notes =====
Line 9: Line 9:
 ===== Requirements ===== ===== Requirements =====
  
-  * At least **eight gigabytes** of free RAM. (I am not joking. Matcher is not optimized for RAM usage at all. Swap memory might be enough.)+  * At least **six gigabytes** of free RAM. (I am not joking. Matcher is not optimized for RAM usage at all. Swap memory might be enough.) (6GB actually works on liach's device)
     * Note that Matcher doesn't actually need this much - its constant memory usage seems to peak at about 4GB heap during the first auto match, and after that is done it seems to use under 1GB heap; the thing is, the auto matching process generates an insane amount of object churn (again, optimized for code clarity rather than memory performance) and as such benefits from a high ceiling of memory.     * Note that Matcher doesn't actually need this much - its constant memory usage seems to peak at about 4GB heap during the first auto match, and after that is done it seems to use under 1GB heap; the thing is, the auto matching process generates an insane amount of object churn (again, optimized for code clarity rather than memory performance) and as such benefits from a high ceiling of memory.
-  * A cloned repository of Yarn, on the **A** version. +  * A cloned repository of [[https://github.com/FabricMC/yarn|Yarn]], on the **A** version. (Not required, but convenient for getting merged jars) 
-  * A cloned repository of the Intermediary mappings. +  * A cloned repository of the [[https://github.com/FabricMC/intermediary/|Intermediary mappings]]
-  * A compiled copy of [[https://github.com/FabricMC/Matcher|the Fabric fork of Matcher]].+  * A compiled copy of Matcher. (Only runs on java 11 or later!) 
 +    * Consider using [[https://github.com/FabricMC/Matcher|the Fabric fork of Matcher]] for easy building of fat jars that ships openjfx.
     * The Fabric fork differs solely in its inclusion of a Gradle build script for easy use - it generally tracks sfPlayer1's upstream.     * The Fabric fork differs solely in its inclusion of a Gradle build script for easy use - it generally tracks sfPlayer1's upstream.
-    * A local installation of Gradle (preferably 4.x) is required to compile the Fabric fork. You need to manually bump the version of shadow plugin to 4.0.1 if you have Gradle 5.x installed+    * A local installation of Gradle (preferably the latest, as of writing 6.3) is required to compile the Fabric fork. The Gradle major version should be at least 5. 
-  * A compiled copy of Stitch.+  * A compiled copy of [[https://github.com/FabricMC/stitch|Stitch]]. 
 +    * Allows for intermediary generation, the core of updating to a new Minecraft version. 
  
 ===== The Process ===== ===== The Process =====
Line 22: Line 25:
 ==== Preparations ==== ==== Preparations ====
  
-  - Clone the current Yarn version at **A**. +  - Enter the current Yarn version at **A**. 
-  - Run ''%%gradlew mergeJars downloadMcLibs%%''. This will create **A**-merged.jar and .gradle/minecraft/**A**-libraries. You will need these for Matcher+  - Run ''%%gradlew mergeJars downloadMcLibs%%''. This will create **A**-merged.jar and .gradle/minecraft/libraries. You will need these for Matcher.
-  - Export the mappings to the offical namespace ''%%gradlew exportMappingsOfficial%%'' these will be used by mater later.+
   - Edit build.gradle to point to the **B** Minecraft version.   - Edit build.gradle to point to the **B** Minecraft version.
-  - Run ''%%gradlew mergeJars downloadMcLibs%%'' again. This will create files as above, but for **B**.+  - Run ''%%gradlew mergeJars downloadMcLibs%%'' again. This will create **B**-merged.jar and grab new libraries (if there is any)
   - Launch Matcher, with -Xmx6G at the very least and -Xmx8G recommended, depending on your amount of RAM.   - Launch Matcher, with -Xmx6G at the very least and -Xmx8G recommended, depending on your amount of RAM.
   - Create a new project and configure its **inputs** (the -merged JARs) and **class paths** (the libraries).   - Create a new project and configure its **inputs** (the -merged JARs) and **class paths** (the libraries).
     * The shared class path can be used for libraries whose versions have not changed between **A** and **B**.     * The shared class path can be used for libraries whose versions have not changed between **A** and **B**.
-  - Wait.+  - Wait for it to match. It takes quite a while.
   - In Matcher, ''%%View -> Sort by Matched Status%%''.   - In Matcher, ''%%View -> Sort by Matched Status%%''.
   - Run ''%%Auto Match All%%'' to perform the initial matches.   - Run ''%%Auto Match All%%'' to perform the initial matches.
  
 ==== Matching ==== ==== Matching ====
 +
 +=== Notes ===
 +You can use mojang's offical mappings, or official -> named yarn mappings as an input for side A (and B if using mojang mappings) to aid with the matching process. To generate these yarn mappings clone yarn, and run `gradlew.bat exportMappingsOfficial`
  
 Matching is a process that cannot be easily described. Essentially, there are three states: Matching is a process that cannot be easily described. Essentially, there are three states:
Line 61: Line 66:
  
   - Save the matches as ''%%matches/A-B.match%%'' in the Intermediary repository.   - Save the matches as ''%%matches/A-B.match%%'' in the Intermediary repository.
-  - Run the following command: ''%%stitch_cmd updateIntermediary yarn/A-merged.jar yarn/B-merged.jar mappings/A.tiny mappings/B.tiny matches/A-B.match%%''. This will use the match information to update the intermediary mappings, preserving mod call compatibility where possible.+  - Run the following command (assuming you run from the root directory of intermediary repo and you have the stitch jar there): ''%%java -Dstitch.counter=counter.txt -jar <path to stitch jar> updateIntermediary <path to A-merged.jar> <path to B-merged.jarmappings/A.tiny mappings/B.tiny matches/A-B.match%%''. This will use the match information to update the intermediary mappings, preserving mod call compatibility where possible, and will use the global counter so when two versions branching off the same version won't have intermediary conflicts (e.g20w14infinite and 20w14a)
     * This might find duplicate mappings, when Mojang combines multiple old method calls into one method call. In this case, your best bet is to try to find the most "common" option and tell Intermediary to settle on that. (Often, it's the one provided by an interface)     * This might find duplicate mappings, when Mojang combines multiple old method calls into one method call. In this case, your best bet is to try to find the most "common" option and tell Intermediary to settle on that. (Often, it's the one provided by an interface)
  
 ==== Updating Yarn ==== ==== Updating Yarn ====
  
-  - Make sure Yarn has no important PRs dangling - it's somewhat annoying to deal with them later! 
   - Open the Enigma mappings from ''mappings_official'', with **Type: Names**, **Target: A (left)** and **"Replace" checked**.   - Open the Enigma mappings from ''mappings_official'', with **Type: Names**, **Target: A (left)** and **"Replace" checked**.
   - Save the Enigma mappings **TO A NEW DIRECTORY**, with **Environment: B (right)**, **Source name type: PLAIN**, **Target name type: MAPPED_PLAIN** and **Verbosity: ROOTS**.   - Save the Enigma mappings **TO A NEW DIRECTORY**, with **Environment: B (right)**, **Source name type: PLAIN**, **Target name type: MAPPED_PLAIN** and **Verbosity: ROOTS**.
tutorial/updating_yarn.1567362226.txt.gz · Last modified: 2019/09/01 18:23 by modmuss50