Development

From GT New Horizons

Tools

WIP

Setting up a Development Environment

From Scratch

  1. Create a new GitHub repository and clone it
  2. Download the Forge Src (build 1614!) and extract the contents of the ZIP-archive into the directory, where you cloned your repository to.
  3. Open ./gradle/wrapper/gradle-wrapper.properties with your favorite text editor and change distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip to distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip.
  4. Open ./build.gradle with your favorite text editor and replace the buildscript { ... } part with this.
  5. Edit your project details (name, version, dependecies, etc.) in the build.gradle file.
  6. Open the command prompt in your workspace directory and execute gradlew wrapper --gradle-version=5.6.4.
  7. Execute gradlew setupDecompWorkspace.
  8. If you want to use Eclipse, execute gradlew eclipse, open Eclipse and point the workspace location to the eclipse folder in your workspace directory. If you want to use IntelliJ IDEA, execute gradlew idea and open the .ipr file.
  9. Done.

From an existing Repository

  1. Clone the repository
  2. If you want to use Eclipse, download the Forge Src (build 1614!) and copy the eclipse folder into your workspace directory.
  3. Execute gradlew setupDecompWorkspace.
  4. If you want to use Eclipse, execute gradlew eclipse, open Eclipse and point the workspace location to the eclipse folder in your workspace directory. If you want to use IntelliJ IDEA, execute gradlew idea and open the .ipr file.
  5. Done.

Maven/Jenkins Selection

URL Mods
http://files.minecraftforge.net/maven Biomes O' Plenty, HelpFixer, MalisisCore, MalisisDoors, Mixin, IronChest, ...
http://chickenbones.net/maven/ CodeChickenCore, CodeChickenLib, EnderStorage, NotEnoughItems, Translocator, WR-CBE, ...
http://maven.ic2.player.to/ IndustrialCraft, Forestry, ...
http://maven.tterrag.com EnderIO, EnderZoo, Chisel, ...
http://dvs1.progwml6.com/files/maven IguanaTinkerTweaks, HungerOverhaul, Mantle, Natura, TinkersConstruct, ...
http://www.ryanliptak.com/maven/ AppleCore
http://jenkins.usrv.eu:8081/nexus/content/repositories/releases/ YAMCore
http://jenkins.usrv.eu:8081/nexus/content/repositories/thirdparty/ Baubles, TicTooltips
http://downloads.gtnewhorizons.com/Mods_for_Jenkins/ Various
https://gregtech.overminddl1.com/ Various
http://files.projectredwiki.com/maven MrTJPCore, ForgeRelocation, ProjectRed
http://maven.cil.li/ OpenComputers, ...
http://mobiusstrip.eu/maven JABBA, WAILA, ...
http://www.mod-buildcraft.com/releases/BuildCraft/ Buildcraft
https://files.vexatos.com AsieLib, BuildcraftOilTweak, TGregworks, ...
https://jenkins.bdew.net/maven%22 AE2Stuff, BDLib, Gendustry, ...
https://www.cursemaven.com Any CurseForge file
https://repo.spongepowered.org/maven/ Mixin, ...
http://maven.k-4u.nl/ InGameWiki, ...
https://minecraft.curseforge.com/api/maven/ Any CurseForge file

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 @Override annotation when overriding methods.

Wikis

Not every wiki 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.

This list will be sufficient for most basic use cases.

URL Versions Topics (including, but often not limited to)
https://minecraft.gamepedia.com/Minecraft_Wiki All Everything related to vanilla Minecraft, though there is information about mods aswell
https://wiki.vg/Main_Page All? Protocols, Authentification, NBT, etc.
https://forums.minecraftforge.net/ All Everything related to Forge modding. This is a forum, not a wiki but you may still find information in old threads. Be aware that 1.7.10 is not supported anymore, so you'll likely receive no answer if you ask something related to 1.7.10 there.
https://www.khronos.org/opengl/wiki/Main_Page * OpenGL
https://mcforge.readthedocs.io/en/latest/

(https://mcforge.readthedocs.io/en/latest/legacy/ for legacy versions)

1.12+ Getting started, Concepts, Blocks, Items, TileEntities, Rendering, Events, Networking, ..
https://greyminecraftcoder.blogspot.com/ 1.6 - 1.7, 1.14+ Concepts, Blocks, Items, Rendering, User Input, Packets, Entities, GUIs, Containers, Tools, Restone, ...
https://0fps.net/ * Collision Detection, Geometry, Mathematics, Voxels, Shape Modelling, Ambient Occlusion, ...
https://www.redblobgames.com/ * Path Finding, Graph Theory, Map Generation, Procedural Generation
https://www.wikipedia.org/ * More than you can think of (but not everything)
#knowledgebase (Minecraft Pack Developement Discord) All Various bits of information on Mod(pack) Developement
#resources (Blockbench Discord) All Modeling, Textures, Animation
https://docs.google.com/spreadsheets/d/1dxmloJUSox8xdMtHZCZAqeLQgG9Yb6sLYyviOyNcwck/ 1.7-1.12 Concepts and Tips & Tricks for Modpack developement
https://docs.oracle.com/javase/tutorial/ * Java Documentation
https://github.com/Ladysnake/Satin/wiki/Data-driven-shaders 1.7+ Post Process Shaders
https://github.com/MinecraftModDevelopment/Modding-Resources All Blocks, Commands, Entities, Fluids, Items, Rendering, ...
https://ftbwiki.org/Feed_The_Beast_Wiki All Information on many Mods
https://ftb.gamepedia.com/FTB_Wiki All Information on many Mods
https://ae-mod.info/ 1.7+ Applied Energistics
https://wiki.industrial-craft.net/index.php?title=Main_Page Beta 1.3+ Industrial Craft
http://minetweaker3.powerofbytes.com/wiki/Main_Page

https://docs.blamejared.com/

1.6.4, 1.7

1.12, 1.14+

MineTweaker / CraftTweaker
https://docs.google.com/spreadsheets/d/1Rsz0rH9tIVJxr18b1Z6-QxOSaEKssxF7u2naQTq2Mqg/ 1.7.10 GTNH Spreadsheet
https://git-scm.com/docs * Git
https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.7.10-10.13.4.1614/ 1.7.10 Forge 10.13.4.1614 JavaDocs

* This wiki does not (mainly) cover specifics of Minecraft/Forge but some concepts described here apply in Minecraft aswell.

Help

Debugging

WIP

https://discord.com/channels/181078474394566657/603348502637969419/805122033167237175

Miscellaneous

How to...

...get...

...an Item
import cpw.mods.fml.common.registry.GameRegistry;
GameRegistry.findItem(String modId, String name);

Vanilla Items are located in net.minecraft.init.Items.

...a Block
import cpw.mods.fml.common.registry.GameRegistry;
GameRegistry.findBlock(String modId, String name);

Vanilla Blocks are located in net.minecraft.init.Blocks.

...a Fluid
import net.minecraftforge.fluids.FluidRegistry;
FluidRegistry.getFluid(String fluidName);

Vanilla Fluids are located in net.minecraftforge.fluids.FluidRegistry.

...an ItemStack
import cpw.mods.fml.common.registry.GameRegistry;
GameRegistry.findItemStack(String modId, String name, int stackSize);

If you want to change the meta-data, do

import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
ItemStack stack = GameRegistry.findItemStack(String modId, String name, int stackSize);
Items.apple.setDamage(stack, int damage); // Items.apple can be any instance of net.minecraft.item.Item
...a FluidStack
import net.minecraftforge.fluids.FluidRegistry;
FluidRegistry.getFluidStack(String fluidName, int amount);

...add...

...a Shaped Recipe
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.item.ItemStack;
GameRegistry.addShapedRecipe(ItemStack output, Object... params);
...a Shapeless Recipe
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.item.ItemStack;
GameRegistry.addShapelessRecipe(ItemStack output, Object... params);
...a Shaped OreDict Recipe
import cpw.mods.fml.common.registry.GameRegsitry;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.ShapedOreRecipe;
GameRegistry.addRecipe(new ShapedOreRecipe(ItemStack result, Object... recipe));
...a Shapeless OreDict Recipe
import cpw.mods.fml.common.registry.GameRegsitry;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.ShapelessOreRecipe;
GameRegistry.addRecipe(new ShapelessOreRecipe(ItemStack result, Object... recipe));
...a Smelting Recipe
import cpw.mods.fml.common.registry.GameRegsitry;
import net.minecraft.item.ItemStack;
GameRegistry.addSmelting(ItemStack input, ItemStack output, float xp);