Skip to content
This repository has been archived by the owner on Mar 21, 2019. It is now read-only.

How To: GMCP and IntelliJ Idea

HoBoS_TaCo edited this page Oct 23, 2013 · 1 revision

This tutorial will show you how to set up GMCP with IntelliJ. It assumes you have Gradle and IntelliJ installed along with a working buildscript. Folder Layout

You are going to want to use the standard java project layout with GMCP. This means the build.gradle file is at the root of the directory, as seen on the image below. All java code goes in the java folder and the resources (assets, mcmod.info and pack.mcmeta) go in the resources folder. If you are using another language such as groovy or scala, these go in folders named groovy or scala in the same directory as the java and resources folders.

Layout

Now you are going to want to set up the GMCP Development environment in order to code your mod. First you will need to open a command line window at set it to the directory with the build.gradle file. To set the current directory you can use the following commmand:

cd D:\TestMod

To set up the development environment you can use the following command:

gradle setupDevWorkspace

Once this finishes there will be a number of new folders in the TestMod directory.

Now you are ready to set up IntelliJ Idea. At this point you should have to the program installed. once you open it you will be greeted by the following screen. On it you will want to click Import Project and select your desired build.gradle file.

Import Project

You will will now want to progress through the next two screens and you likely won't have to make any changes.

Project

Structure

Once you have clicked finish you will be able to see your workspace. It should look something like this:

Workspace

Now you will need to select all the Forge, FML, Minecraft and Resources directories, right click them and Mark Directory as Source Root.

Mark Directory

This is enough to begin development in IntelliJ however you are going to want to set up the test runs. You can do this by selecting Run > Edit Configurations...

Edit Configurations

The client should look like this:

Client

Main class: net.minecraft.launchwrapper.Launch

Program arguments: --version 1.6 --tweakClass cpw.mods.fml.common.launcher.FMLTweaker

VM options: -Djava.library.path="D:\TestMod\minecraft\natives" -Xincgc -Xmx1024M -Xms1024M

The server should look like this:

Server

Main class: cpw.mods.fml.relauncher.ServerLaunchWrapper

VM options: -Xincgc -Xmx1024M -Xms1024M

-Tutorial by @HoBoS-TaCo