When compiling mods in recent versions of IntelliJ, weird things start happening:
- With ForgeGradle 2 (1.12-), none of the assets show up in-game (language keys, models, textures etc)
- Broken hotswapping.
- Potentially other Bad, Terrible Things that are yet to be discovered.
- Open Settings (head to File -> Settings).
- Expand "Build, Execution, Deployment".
- Expand "Build Tools".
- Expand "Gradle".
- Under the right pane, under "Build and Run", change both from "Gradle" to "IntelliJ Idea".
- Apply.
- Restart IntelliJ (quick way: is File -> Invalidate Caches / Restart -> Just Restart)
You will need to change this once for every project.
You also may have to set the project build directory after configuring this, since IntelliJ forgot; just use the build/
directory (in the root of your project, adjacent to src/
, probably already exists if you compiled it before).
(This probably doesn't happen in 1.13+, but it certainly does in 1.12-)
- Open the Run/Debug configurations dialog (expand the run configs dropdown -> Edit Configurations...)
- Under "Use classpath of module", change it to the one that ends in ".main"
- Do this for each run configuration.
IntelliJ changed its model of how Gradle tasks are executed. Resources get put in a different folder from where ForgeGradle expects to find them, hot-swapping doesn't work, etc.
Thanks to Tama for figuring out the resources issue on MMD. Thanks to Paul Fulham for pointing out that it also breaks hotswapping and by "pointing out" I mean that he found out the hard way and had to find out how to fix it. I'm just posting this somewhere I can link to it.