Development

Introduction
Everyone can contribute to GTNH in one way or another. One possible way is to expand/improve the source code of the mods. To get started, you first need a vision for what you want to do. If you have no idea you can look through [issues] and try to address some. If you do have a vision and are unsure whether its good or want to hear more opinions on it you can discuss it with others in a new issue or on discord.

Getting started
If you found a mod that you want to edit, create a fork of it first, by pressing the fork-button on its GitHub page. After that you can clone your fork to a local repository and import it into your IDE and get started on development. If you are unsure how to do things, try to look up how similar things are already done.

From Scratch

 * 1) Create a new GitHub repository and clone it
 * 2) Choose and download a Forge MDK and extract the contents of the ZIP-archive into the directory, where you cloned your repository to (If you are developing for Minecraft 1.7.10, you can use SinTh0r4s' -template).
 * 3) Edit your project details (name, version, dependencies, etc.).
 * 4) Execute  /   in the root directory of your project
 * 5) In Eclipse / IntelliJ IDEA, import your workspace as a Gradle project.
 * 6) Done.

From an existing Repository

 * 1) Clone the repository
 * 2) Execute  /   in the root directory of your project
 * 3) In Eclipse / IntelliJ IDEA, import your workspace as an existing Gradle project.
 * 4) If the import fails, you may have to adjust the Gradle version and/or buildscript. If you are developing for Minecraft 1.7.10, read this guide.
 * 5) Execute  if you are using IntelliJ to run the project inside your IDE.
 * 6) Done.

Common issues

 * If even after you executed the  command your IDE tells you that stuff is missing, try to reload gradle.
 * You need Java 8 (64 bit) for development. If you have multiple Java versions installed you may need to set the JAVA_HOME environment variable to the location of your Java 8 installation.

Git Configuration
If you would like to avoid signing commits with your real name, see here: Managing Git Identities

Tools
All applications that are grouped together can do about the same. This does not mean that you can pick any one of them, as they differ in functionality, style, performance and customizability. It is recommended you look at what they can do and try each one out, so you can decide which application you want to use for which use case.

Code Editors

 * Notepad++
 * Visual Studio Code
 * Sublime Text
 * Atom

Integrated Development Environments

 * Eclipse Note: as of version 4.17 Eclipse requires Java 11 or newer but you can still get older versions which support Java 8.
 * IntelliJ IDEA

Image Editors

 * GIMP
 * Paint.NET
 * Krita
 * LibreSprite
 * Aseprite Paid
 * Photoshop Paid

Modeling

 * Blockbench
 * MagicaVoxel
 * Blender

Animation

 * Block Model Animator
 * Animated Textures Editor
 * LibreSprite

Miscellaneous

 * JSONLint
 * Palette Library
 * Resource Pack Workbench
 * Bearded-Octo-Nemesis 2 (BON2)
 * FernFlower
 * Java Decompiler
 * MCP Mapping Viewer

Code Style

 * Keep your added variables either private or constant unless absolutely necessary
 * Don't touch existing public variables' implementation, as this can break code using those variables.
 * Use thread-safe collections where you can, to make future multithreading possible
 * Comment your code, especially Javadoc-ing your methods and classes, if able
 * Try not to make one method do too much. Add helper methods if you need
 * Use the  annotation when overriding methods.
 * Avoid hard-dependencies
 * Please do semantic versioning.
 * Use the  provided with the project or use this   if none was provided.

Contribution Procedure
Please do not have multiple changes/features in a single PR, make a separate PR for each. If they depend on each other, you can leave a note in the PR's description.
 * 1) Find something to contribute
 * 2) Fork the related projects (can skip this if you are a member of our github org)
 * 3) For certain old repos, buildscripts may need updating. See this guide.
 * 4) Push code into your fork (or on a separate branch in main repo)
 * 5) Open a pull request and provide a description on what it changes/adds/removes. Include pictures/graphs if necessary. If there is a related issue, link it. Ask for review from
 * 6) * DreamMasterXXL, if it's about quest and/or recipe change.
 * 7) * GTNewHorizons/developers team, if it's some java/scala/kotlin code change.
 * 8) * mitchej123, if it's NEI.
 * 9) * Original mod developer, if you are contributing to his mod and he/she is still around (e.g. glease for TC4Tweaks, SinTh0r4s for VisualProspecting, GlodBlock for GoodGenerators).
 * 10) Address review problems. Resolve merge conflicts (if any). Wait for final merge. DO NOT merge the PR yourself, even if approved! This is a task of GTNewHorizons/admin members.

If you are not sure how to fork and open pull requests, read this gist by Chaser324.

Resources
Not every wiki/tutorial/article/... listed here contains information about Minecraft version 1.7.10 but some topics haven't changed much and often the general methodology is the same. The newer the version, the less comparable the inner workings of Minecraft/Forge are to 1.7.10.

You can look at the source-code of most mods included in GTNH here.

If you look for something specific, use the search-function of your browser!

You can find an extensive list of modding resources, made by the MMD-Team, here.

Help

 * Mathematics on StackExchange: Forum for everything related to Mathematics
 * StackOverflow: Forum for everything related to Programming
 * #mod-dev ( GTNH Discord)
 * #mc-dev-other ( Minecraft Mod Development Discord)
 * #moddev ( Minecraft Pack Development Discord)
 * #mc-dev ( CurseForge Discord)
 * #help-modded-java ( Blockbench Discord)

Using DCEVM
For better hot-reload support in intellij you can use DCEVM. Instructions for linux:


 * unpack https://github.com/TravaOpenJDK/trava-jdk-8-dcevm/releases/tag/dcevm8u282b08 somewhere
 * go into the unpacked jvm, in  make a copy of   called  ; afterwards copy the entire   folder and name it   (this tricks the intellij plugin into thinking the dcevm install is valid as installed by the old 2018 installer)
 * install HotSwapAgent plugin in intellij https://plugins.jetbrains.com/plugin/9552-hotswapagent
 * Add the dcevm jdk as an SDK in intellij, it should autodetect most stuff but I had to manually copy over the javadoc path from my other java8 jdk
 * Set the dcevm jdk as default for the project and gradle
 * Set the non-dce jdk in Build,Exec&Deployment->Compiler->Scala Compiler->Scala Compile Server
 * In build tools->gradle set both build&run and run tests to using IntelliJ IDEA instead of Gradle
 * In Tools->HotSwapAgent enable it for all configurations and set the agent path to  (in your dcevm installation)
 * Make sure to use the Minecraft Client/Server intellij configurations with the square frame icons instead of the runClient/etc. configurations with gradle icons
 * Debugging that config should show up loading the hot swap agent at the beginning of the logs
 * If you have custom jvm args in the configs, make sure to remove all gc-related options as dcevm is works only with the default gc

Useful Options

 * -Dmixin.debug=true # Enable Mixin Debug
 * -Dmixin.debug.verbose=true # Verbose Debug Messages
 * -Dmixin.debug.export=true # Export classes after mixins have been applied.  If you include fernflower in your classpath, or copy org.jetbrains.fernflower into your mixin jar the exported classes will be decompiled
 * -Dmixin.debug.countInjections=true  # Throw an error if the injection count doesn't match expectations
 * -Dlegacy.debugClassLoading=true # Class Load Debugging
 * -Dlegacy.debugClassLoadingSave=true # Dump classes to `.minecraft/CLASSLOADER_TEMP`