Advertisement
Guest User

Untitled

a guest
Oct 8th, 2016
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.63 KB | None | 0 0
  1. Configuring Forge with IntelliJ IDEA
  2. =====================================
  3.  
  4. Pre-Requisites
  5. -----------------
  6.  
  7. Before you even get started, you'll want to make sure of a couple things so that the following section will run smoothly.
  8.  
  9. First in IntelliJ IDEA (IDEA for short), make sure that you have configured a **64bit JDK** installation in the `Project Structure / SDKs` configuration section.
  10.  
  11. Then, edit or create `%USERPROFILE%\.gradle\gradle.properties` (`~/.gradle/gradle.properties` for Linux/unix users), and in it, add `org.gradle.jvmargs=-Xmx3G` (2G may be enough if you have limited memory). This is not strictly necessary, but it's safer to tweak this.
  12.  
  13. Once this is done, you can start with the actual setup process.
  14.  
  15. Setting up the project
  16. -----------------------
  17.  
  18. Begin by creating a folder with the name you want to give your project, and in it, extract the contents of the MDK zip (choose the latest version for working on new mods, the recommended download may not contain the latest features).
  19. You can get rid of most files from that zip. The important ones are the `gradle` folder, the `gradlew`/`gradlew.bat` files, the `build.gradle` file and the `src` folder (if you already have sources, use them instead of the example code).
  20.  
  21. Launch IDEA and choose to open/import the `build.gradle` file, using the default gradle wrapper choice.
  22.  
  23. While you wait for it to finish importing, you can open the gradle panel (if you can't find it, click on the icon on the bottom-left corner of the IDEA window). Once it's done, this panel will contain the tasks.
  24.  
  25. Unfold the `forgegradle` task group, and double-click on the `setupDecompWorkspace` task. It will take a few minutes, and use quite a bit of RAM (hence why the pre-requisites suggest the max ram increase).
  26.  
  27. Once the setup task is done, you will want to run the `genIntellijRuns` task, which will configure the project's run/debug targets. This task will be a lot quicker to finish.
  28.  
  29. Once it's done, you should click the blue refresh icon **on the gradle panel** (there's another refresh icon on the main toolbar, but that's not it). This will re-synchronize the IDEA project with the Gradle data, making sure that all the dependencies and settings are up to date.
  30.  
  31. Finally, assuming you use IDEA 2016 or newer, you will have to open the run configurations dropdown, click on `Edit configurations...` and in both `Minecraft Client` and `Minecraft Server`, edit the `Use classpath of module` option to point to the task with a name like `<project>_main`.
  32.  
  33. If all the steps worked correctly, you should now be able to choose the Minecraft run tasks from the dropdown, and then click the Run/Debug buttons to test your setup.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement