Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Using Intellij IDEA for Mod-Development with ForgeGradle


Recommended Posts

If you are using Intellij 14 (which you should) you need to add the following to the end of your build.gradle before importing:

sourceSets {
    main {
        output.resourcesDir = output.classesDir
    }
}

If you don't do that, your assets will not work. (Thanks to Cazzar for this solution)

 

Can we get this posted as a sticky?!?! For something that's mentioned in passing, it's pretty damn important for new modders. It took me two days of searching and trying out different things to figure out what was going on.

  • Like 1
Link to post
Share on other sites
  • 1 month later...
  • Replies 132
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Note (Sep. 2017): This post is now getting very old, but it still applies. Regardless you might want to refer to the IntelliJ section in the official Getting Started guide instead.   In this

Thanks, now it works and I created my very first mod which does absolutely nothing at all :-)

Can we get this posted as a sticky?!?! For something that's mentioned in passing, it's pretty damn important for new modders. It took me two days of searching and trying out different things to figure

If the steps above don't work, try one more thing:

 

Get out of IntelliJ all the way before you do the setupDecompWorkspace.

 

Then, when you re-start IntelliJ, on the first screen, delete the project from the list.  This will not delete it from the disk, just from the list of available projects at startup.

 

Then click import project and import it like you did the first time, by selecting the build.grade file.

 

After I did this, it finally worked correctly for me.

Link to post
Share on other sites
  • 2 weeks later...

Get out of IntelliJ all the way before you do the setupDecompWorkspace.

 

Then, when you re-start IntelliJ, on the first screen, delete the project from the list.  This will not delete it from the disk, just from the list of available projects at startup.

 

Then click import project and import it like you did the first time, by selecting the build.grade file.

 

You don't have to delete it from the list. Just do the importing again and the effect is the same.

just you wait! ;)

Link to post
Share on other sites

So, I applied the IDEA fix here. Now Minecraft starts fine from IDEA, but from console it crashes.

 

Command used:

 

./gradlew runClient

 

Crash:

 

java.lang.IllegalArgumentException: Multiple entries with same key: easyforger_dungeons=FMLMod:easyforger_dungeons{0.1} and easyforger_dungeons=FMLMod:easyforger_dungeons{0.1}

 

Anyone else experiencing this?

just you wait! ;)

Link to post
Share on other sites

Well, forge is completly gone from "External Libraries" for me. Every reference to a class in forge is red. What do I do?

 

I mentioned this on another thread:

Well, now it isn't solved anymore. I added the source set thing (I don't know what to call it, ok?) and it did its thing. Then out of nowhere all the references in my code to any class of Forge or Minecraft went red. I checked the "External Libraries" at the bottom and it has a file called "start" and a file called "< 1.8 >". I think 1.8 is the Java JDK. But the forge jar is gone. Any help?

Link to post
Share on other sites

I found a way better workaround to the "Resource not found" problem, which doesn't mess around with the outputDirs in a way of having duplicate resources in your jar files:

apply plugin: 'idea'
idea {
    module {
        inheritOutputDirs = true
    }
}

 

Put that into your build.gradle and remove the

output.resourcesDir = output.classesDir

Refresh your gradle workspace and your resources should work.

 

Source: https://youtrack.jetbrains.com/issue/IDEA-120939#comment=27-772614

Tested it myself and it works.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to post
Share on other sites

I found a way better workaround to the "Resource not found" problem, which doesn't mess around with the outputDirs in a way of having duplicate resources in your jar files:

apply plugin: 'idea'
idea {
    module {
        inheritOutputDirs = true
    }
}

 

Put that into your build.gradle and remove the

output.resourcesDir = output.classesDir

Refresh your gradle workspace and your resources should work.

 

Source: https://youtrack.jetbrains.com/issue/IDEA-120939#comment=27-772614

Tested it myself and it works.

Jeez you are the man. Thanks!

Maker of the Craft++ mod.

Link to post
Share on other sites

I need help. I encounterd this error when importing build.gradl

 

Please, use JDK instead of JRE for Gradle importer. <a href='#open_external_system_settings'>Open Gradle Settings</a>

 

 

Consult IDE log for more details (Help | Show Log)

 

I have the latest version of Java and the Java JDK so I dont know why im getting this error.

 

Link to post
Share on other sites

When i tried to do all of these. I get stuck at importing build.gradle. It errors "No such version exists!". Please Help!

 

I tried to use a seperate newly unzipped folder for using intellij. (I have an eclipse one aswell. It didn't work there too)

 

(sorry for bad english)

because im Turkish

Link to post
Share on other sites

I Forgot to do 

gradlew setupDecompWorkspace --refresh-dependencies

on the Fresh Unzipped IDEA-Only folder. i'll come back later when it finishes and (hopefully) works.

 

EDIT: build fails on line  25 (

version = "1.8-11.14.1.1344"

) with the same error (

No such version exists!

)

 

(sorry for bad english)

because im Turkish

Link to post
Share on other sites

I have gotten to the point to make my mcmod.info file. I made and i put in this format

 

[

{

  "modid": "",

  "name": "",

  "description": "",

  "version": "",

  "mcversion": "",

  "url": "",

  "updateUrl": "",

  "authorList": [

    ""

  ],

  "credits": "",

  "logoFile": "",

  "screenshots": [

  ],

  "parent":"",

  "dependencies": [

  ]

}

]

 

and filled it in but in game it doesnt recognize my mcmod.info file

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.