Setup is a little bit more involved than just a normal Forge dev workspace setup but isn't too hard. Follow these steps and you should be ready to submit pull requests.
- Windows:
setup.ps1
- Unix:
setup.sh
- Note: You may need to run
sudo chmod a+x ./setup.sh
before running the script.
- Note: You may need to run
- open the project within IDEA by clicking the recently created .ipr file
- right click project > open module settings
- project > project language level > SDK default (8)
- file > settings
- plugins > browse all repositories > search "lombok" > install
- still in settings > Build, Execution, Deployment > Annotation Processors > Enable annotation processing (in newer versions of IntelliJ settings > Build, Execution, Deployment > Compiler > Annotation Processors > Enable Annotation Processing)
- down that page > Annotation Processor options > green +
- run > edit configuration
- Use classpath for module > select the main ct.js (it might be named differently depending on your fork)
- Program arguments
CT uses a preprocessor to develop the mod using one codebase for multiple versions. The preprocessor used is the same as the one the Replay Mod uses. You can read up more information on it there. One example of this code is:
//#if MC>=11200
// This is the block for MC >= 1.12.0
category.addDetail(name, callable::call);
//#else
//$$ // This is the block for MC < 1.12.0
//$$ category.setDetail(name, callable::call);
//#endif
Note: Code for the default target Minecraft version (1.8.9) shall be placed in the first branch of the if-else-construct. Additionally, all version specific imports shall be placed after all normal imports, but before any static or java.* imports.
- Run
./gradlew changeMcVersion -PminecraftVersion=<version code>
The versions supported are listed in theversions.txt
file, with 1.8.9 (code10809
) being the default. - Next, run
./gradlew copySrg setupDecompWorkspace
to generate the new mapping files, as well as decompile Minecraft to the new version. (Side Note: If the desired version is 1.8.9, you will need to run the gradle wrapper commands, excluding the idea one, found in instruction #3) - Finally, you will need to refresh the Gradle project in IntelliJ by pressing the spinning blue arrows in the
Gradle panel on the right hand side of your workspace.
Make sure to change back to MC version 1.8.9 before pushing or making pull requests.
Everything should now be set up and ready to open pull requests.