The steps I follow to update my mods, and work for me:
step 1: I make a copy of the entire folder (or git clone... a branch works too but I don't like to use different-version branches in the same clone)
step 2: I copy over the
gradle folder and
gradlew scripts from the MDK, nothing else
step 3: I edit the
build.gradle to use FG 5.1+
step 4: I open a cmd window with java16 in the JAVA_HOME
step 5: I run [OPTIONAL, IF YOU ARE ALREADY ON 1.16.5 OFFICIAL NAMES SKIP]
gradlew -PUPDATE_MAPPINGS=1.16.5 -PUPDATE_MAPPINGS_CHANNEL=official updatemappings
step 6: I edit the build.gradle mappings line to: [THIS IS IMPORTANT!!]
mappings channel: 'official', version: '1.16.5'
NOTE: You may want to verify that your code compiles, before continuing. If the code fails to compile then the updateClassnames may fail and mess up your code.
step 7: I add this line after the
apply plugin lines in your build.gradle
apply from: 'https://raw.githubusercontent.com/SizableShrimp/Forge-Class-Remapper/main/classremapper.gradle'
[for more information about this, see https://github.com/SizableShrimp/Forge-Class-Remapper ]
step 8: I run
gradlew -PUPDATE_CLASSNAMES=true updateClassnames
step 9: I change the build.gradle mappings line to
mappings channel: 'official', version: '1.17.1'
step 10: I change the
sourceCompability = ... = '1.8'
java.toolchain.languageVersion = JavaLanguageVersion.of(16)
step 11: I change the forge dependency to
minecraft 'net.minecraftforge:forge:1.17.1-37.0.15' // [USE LATEST HERE, .15 WAS LATEST AT THE TIME OF WRITING]
step 12: Import into intellij, changing intellij's project SDK to java16, and making use the gradle jre uses the project JDK too
step 13: Run
step 14+: fix code and test