Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Parker8283/c8ebc9b8c11772dfda51 to your computer and use it in GitHub Desktop.
Save Parker8283/c8ebc9b8c11772dfda51 to your computer and use it in GitHub Desktop.
Instructions for how to setup a dev env for working on FML/Forge in IntelliJ IDEA

To do this, it's a little tricky. It's assumed that you have already cloned the repo and run the gradle tasks necessary.

  1. Open IDEA
  2. Select "Import Project"
  3. Navigate to the cloned repo, and inside of the eclipse folder, choose the Clean or FML/Forge folder, depending on what your working on (If you don't know, you probably want the FML/Forge folder).
  4. Select the .project file inside of the folder you navigated into, and hit OK. (Make sure you click the button to show hidden files if you don't see the .project file. (It's the last graphic button on the toolbar))
  5. All the default settings should be fine (unless you want the .ipr project format instead of the .idea project format; it doesn't matter), so click Next.
  6. Verify that the correct project is there, and click Next.
  7. Make sure you have the correct JDK selected and click Finish. IDEA will now convert the Eclipse project to an IDEA project.
  8. Once IDEA has set up the project, open the Project Structure (Command + ; on Mac, I assume Ctrl + ; on non-Mac. It's also the second to last graphic button on the top-right toolbar.)
  9. From the left-hand sidebar, select Modules, and make sure that in the tabbed window, you're in the Sources tab.
  10. From the right-hand sidebar, click on the X next to "main/java", "main/resources", and "test/java". IDEA is erroring on them because they're under a different content root. Also, if you see the "build" folder in your folder view, exclude it. If you don't, don't worry about it.
  11. On the top of the right-hand sidebar, click Add Content Root, and select the "src" folder in the root directory of the repo and click OK.
  12. IDEA should automatically detect the sources and catagorize them accordingly. You can tweak with them if you'd like. Otherwise, hit Apply and OK.

At this point, you've setup your devspace for FML/Forge. If you'd like to run MC from IDEA, you will need to do the following:

  1. From the run configurations dropdown, click Edit Configurations.
  2. Click the + icon in the top right, and choose Application.
  3. Enter in the information shown in the text files below for what you want to run (e.g., if you want to run the Client, look at the runClient.txt file below. For server, look at runServer.txt.)
  4. After that, give the configuration(s) a name, save, close the dialog window, and choose one to run.

Everything should work at this point. Let me know if it doesn't.

NOTE: If you are using 1.8.0 or later, change all "cpw.mods" references to "net.minecraftforge"
ALSO NOTE: To find your asset index, go to /Users/xxx/.gradle/caches/minecraft/assets/indexes, and look at the files there. You should be able to figure out which one you need. Then just put the name of the file, minus the .json extension, in place of ${your-asset-index}
Main Class: net.minecraft.launchwrapper.Launch
VM Options: -Xincgc -Xmx1024M -Xms1024M -Djava.library.path="$MODULE_DIR$/../run/bin/natives"
Program Arguments: --version ${your-mc-version} --tweakClass cpw.mods.fml.common.launcher.FMLTweaker --accessToken ${FML or Forge} --assetIndex ${your-asset-index} --assetsDir /Users/xxx/.gradle/caches/minecraft/assets --userProperties {} --username Dev
Working Directory: $MODULE_DIR$/../run
NOTE: If you are using 1.8.0 or later, change all "cpw.mods" references to "net.minecraftforge"
Main Class: cpw.mods.fml.relauncher.ServerLaunchWrapper
VM Options: (none)
Program Arguments: (none)
Working Directory: $MODULE_DIR$/../run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment