Development
Tools
WIP
Setting up a Development Environment
From Scratch
- Create a new GitHub repository and clone it
- Download the Forge Src (build 1614!) and extract the contents of the ZIP-archive into the directory, where you cloned your repository to.
- Open
./gradle/wrapper/gradle-wrapper.properties
with your favorite text editor and changedistributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip
todistributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
. - Open
./build.gradle
with your favorite text editor and replace thebuildscript { ... }
part with this. - Edit your project details (name, version, dependecies, etc.) in the
build.gradle
file. - Open the command prompt in your workspace directory and execute
gradlew wrapper --gradle-version=5.6.4
. - Execute
gradlew setupDecompWorkspace
. - If you want to use Eclipse, execute
gradlew eclipse
, open Eclipse and point the workspace location to theeclipse
folder in your workspace directory. If you want to use IntelliJ IDEA, executegradlew idea
and open the.ipr
file. - Done.
From an existing Repository
- Clone the repository
- If you want to use Eclipse, download the Forge Src (build 1614!) and copy the
eclipse
folder into your workspace directory. - Execute
gradlew setupDecompWorkspace
. - If you want to use Eclipse, execute
gradlew eclipse
, open Eclipse and point the workspace location to theeclipse
folder in your workspace directory. If you want to use IntelliJ IDEA, executegradlew idea
and open the.ipr
file. - Done.
Maven/Jenkins Selection
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 | 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
- 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)
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);