Skip to content

Latest commit

 

History

History
69 lines (63 loc) · 3.82 KB

CONTRIBUTING.md

File metadata and controls

69 lines (63 loc) · 3.82 KB

Development Workspace Setup

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.

0. Set up JDK 8 and set your JAVA_HOME path variable (use google)

1. Clone the repository to your computer

clone repo

2. Run the setup script

  • Windows: setup.ps1
  • Unix: setup.sh
    • Note: You may need to run sudo chmod a+x ./setup.sh before running the script.

3. Set up IntelliJ Idea

  • open the project within IDEA by clicking the recently created .ipr file
    open project
  • right click project > open module settings
    open module settings
  • project > project language level > SDK default (8)
    set language level
  • file > settings
    open idea settings
  • plugins > browse all repositories > search "lombok" > install
    install lombok
  • 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)
    enable annotation processing
  • down that page > Annotation Processor options > green +
    • Option name: reobfSrgFile
    • Value: location-of-fork\mappings\mcp-srg.srg
      set annotation processing option There won't be any file there currently, but as soon as you build, change versions, or run the ./gradlew copySrg command, it will appear.

4. Debug client setup

  • run > edit configuration
    edit configuration
  • Use classpath for module > select the main ct.js (it might be named differently depending on your fork)
    classpath
  • Program arguments
    • --tweakClass com.chattriggers.ctjs.launch.CTJSTweaker
      edit program arguments

5. Developing for different versions

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.

To switch versions

  • Run ./gradlew changeMcVersion -PminecraftVersion=<version code>
    The versions supported are listed in the versions.txt file, with 1.8.9 (code 10809) 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.
    refresh gradle

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.