Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
1.19 client refactor auto-remap guide

Welcome to the 1.19 client refactor auto-remap guide!

Forge 41.0.64 for Minecraft 1.19 introduces several breaking changes to client code and 41.0.94 makes several additional renames.

In this guide we'll set up, configure and run SizableShrimp's automatic remapping tool to go through your code and take care of a large number of changes for you. This will only work if your mod is written in Java, so if it isn't, skip to the manual porting guide.

This guide works regardless of the mappings you're using.

Here's what we'll do:

  1. Ensure the mod compiles
  2. Add the auto-remapping script
  3. Run the script
  4. Remove the script and update Forge

You can find a guide with further manual porting steps and all major changes at the following link:
<link is not ready yet>

⚠️ Note that this will not update everything. You will likely need to make manual changes. ⚠️

Steps

1. Preparing the workspace

First off, you will want ensure you're running ForgeGradle 5 and that you're on a version of Forge prior to 1.19-41.0.64. It can be any version, even 1.18.X or lower, as long as your code compiles correctly.

⚠️ If your code does not compile, the remapping tool will NOT work. ⚠️

 

2. Adding SizableShrimp's auto-remapping script

⚠️ Commit your changes to git and/or make a backup before proceeding. ⚠️

Next, we'll set up the script. To do this, simply add the following after all the plugin lines in your build.gradle:

apply from: 'https://raw.githubusercontent.com/SizableShrimp/ForgeUpdatesRemapper/main/remapper.gradle'

The resulting file will look something like this:

// ["buildscript" block and other plugins]
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'maven-publish'
apply from: 'https://raw.githubusercontent.com/SizableShrimp/ForgeUpdatesRemapper/main/remapper.gradle'
// [The rest of your script]

Or like this:

plugins {
    id 'net.minecraftforge.gradle' version '5.+'
    id 'maven-publish'
}
apply from: 'https://raw.githubusercontent.com/SizableShrimp/ForgeUpdatesRemapper/main/remapper.gradle'
// [The rest of your script]

 

3. Automatically updating references

Now that the script is set up, we will run it. If you have multiple source sets, continue reading.

gradlew -PUPDATE_SRGS="https://gist.githubusercontent.com/amadornes/e00ea624b3cccc84fbca0800f651b546/raw/raw_mappings.tsrg;https://gist.githubusercontent.com/SizableShrimp/882a671ff74256d150776da08c89ef72/raw/forge_1.19_renames.tsrg" updateEverything

For more complex projects using multiple source sets, you will need to manually tell the script to update them. You can do this by adding -PUPDATE_SOURCESETS="<your source sets>" before updateEverything in the previous command, replacing <your source sets> with a semicolon-separated list of target source sets.

For example, if you have main and api, your command would look like this:

gradlew -PUPDATE_SRGS="https://gist.githubusercontent.com/amadornes/e00ea624b3cccc84fbca0800f651b546/raw/raw_mappings.tsrg;https://gist.githubusercontent.com/SizableShrimp/882a671ff74256d150776da08c89ef72/raw/forge_1.19_renames.tsrg" -PUPDATE_SOURCESETS="main;api" updateEverything
⚠️ If you have multiple source sets, run the command just once with all of them specified to ensure it works. ⚠️

 

4. Removing the script and updating Forge

At this point we're done with the script.
Remove the line you added to your buildscript earlier and update Forge to 1.19-41.0.94 or newer.

That's it! Everything that could be automatically updated, has been! 🎉

 

Troubleshooting

If you run into any issues, reach out via the Forge Discord: https://discord.gg/forge in the #modder-support-119 channel and someone will help you out.

⚠️ Please be patient and mindful of others, as everyone helping is doing so voluntarily in their free time. ⚠️

Further changes

Now you will likely need to manually make additional changes.

To aid with that, we have a manual porting guide and change list you can find at the following link:
<link is not ready yet>

@desht
Copy link

desht commented Jul 14, 2022

Quick note if you're running this on Linux/Mac: you'll need to quote the pair of URL's like this (because of the semicolon):

gradlew -PUPDATE_SRGS="https://gist.githubusercontent.com/amadornes/e00ea624b3cccc84fbca0800f651b546/raw/raw_mappings.tsrg;https://gist.githubusercontent.com/SizableShrimp/882a671ff74256d150776da08c89ef72/raw/forge_1.19_renames.tsrg" -PUPDATE_SOURCESETS="main;api" updateEverything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment