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

Using Intellij IDEA for Mod-Development with ForgeGradle


Recommended Posts

  • 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

Where exactly did you put it? And do the names match 100%?

ModID, Author, Version and MC Version all matches.

I put my mcmod.info file in /src/main/resources

ITs located in the resources folder.

Does the file need to be made in a JSON editor?

Link to post
Share on other sites
  • 6 months later...

Hi! Help me please. What I'm doing wrong? All the time I have this error when I start ./gradlew setupDecompWorkspace. When I start script in terminal too.

 

Mac OS X 10.11.1

JDK 7_79

forge-1.8-11.14.4.1563

 

18:18:57: Executing external task 'setupDecompWorkspace'...

:deobfCompileDummyTask

:deobfProvidedDummyTask

:getVersionJson

:extractUserdev

:extractDependencyATs SKIPPED

:extractMcpData SKIPPED

:extractMcpMappings

:genSrgs SKIPPED

:downloadClient SKIPPED

:downloadServer SKIPPED

:splitServerJar SKIPPED

:mergeJars SKIPPED

:deobfMcSRG SKIPPED

:getFernFlower SKIPPED

:decompileMc

:fixMcSources

:applySourcePatches

:remapMcSources

:recompileMc

[ant:javac] warning: [options] bootstrap class path not set in conjunction with -source 1.6

[ant:javac] /Volumes/DocsHD/Minecraft/_CubeModDev/build/tmp/recompileMc/sources/net/minecraftforge/client/model/obj/OBJModel.java:617: error: cannot find symbol

[ant:javac]                    material.getColor().setW(alpha);

[ant:javac]                                        ^

[ant:javac]  symbol:  method setW(float)

[ant:javac]  location: class Vector4f

[ant:javac] Note: Some input files use or override a deprecated API.

[ant:javac] Note: Recompile with -Xlint:deprecation for details.

[ant:javac] Note: Some input files use unchecked or unsafe operations.

[ant:javac] Note: Recompile with -Xlint:unchecked for details.

[ant:javac] 1 error

[ant:javac] 1 warning

:recompileMc FAILED

 

FAILURE: Build failed with an exception.

 

* What went wrong:

Execution failed for task ':recompileMc'.

> Compile failed; see the compiler error output for details.

 

* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

 

BUILD FAILED

 

Total time: 10 mins 5.534 secs

Compile failed; see the compiler error output for details.

18:29:04: External task execution finished 'setupDecompWorkspace'.

Link to post
Share on other sites

 

I did not find any "vecmath" on my computer. I really something did not understand.

 

If I should delete some old vecmath... so, I can not find it.

If  I should install new vecmath.. I do not understand how I should to do this. =\

 

Sorry for my stupid brain.

Link to post
Share on other sites

I resolve this problem by coping Java3D files to Java Extensions folder and now it building successfully. It decompile and minecraft is launching.

 

12:07:26: Executing external task 'setupDecompWorkspace'...

#################################################

        ForgeGradle 2.0-SNAPSHOT       

  https://github.com/MinecraftForge/ForgeGradle 

#################################################

              Powered by MCP 9.10             

            http://modcoderpack.com           

        by: Searge, ProfMobius, Fesh0r,       

        R4wk, ZeuX, IngisKahn, bspkrs         

#################################################

:deobfCompileDummyTask

:deobfProvidedDummyTask

:getVersionJson

:extractUserdev UP-TO-DATE

:extractDependencyATs SKIPPED

:extractMcpData SKIPPED

:extractMcpMappings SKIPPED

:genSrgs SKIPPED

:downloadClient SKIPPED

:downloadServer SKIPPED

:splitServerJar SKIPPED

:mergeJars SKIPPED

:deobfMcSRG SKIPPED

:getFernFlower SKIPPED

:decompileMc SKIPPED

:fixMcSources SKIPPED

:applySourcePatches SKIPPED

:remapMcSources SKIPPED

:recompileMc SKIPPED

:extractNatives SKIPPED

:getAssetIndex UP-TO-DATE

:getAssets

Current status: 524/734  71%

Current status: 723/734  98%

:makeStart SKIPPED

:setupDecompWorkspace

 

BUILD SUCCESSFUL

 

Total time: 53.434 secs

12:08:22: External task execution finished 'setupDecompWorkspace'.

 

But I still have problem. IntelliJ did not see connections between classes:

 

7a73defd83fd4c978360c4346be30a34.png

 

Actually there no required classes in decompiled sources. What i'm doing wrong? o_O

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

I try to run it (I followed everything and using the latest mdk folder of 1.8.9) and I get this error in IntelliJ:

 

11:17:09 PM: Executing external task 'setupDecompWorkspace'...
This set of MCP mappings was designed for MC 1.8.8. Use at your own peril.
#################################################
         ForgeGradle 2.1-SNAPSHOT-8267717        
  https://github.com/MinecraftForge/ForgeGradle  
#################################################
               Powered by MCP unknown               
             http://modcoderpack.com             
         by: Searge, ProfMobius, Fesh0r,         
         R4wk, ZeuX, IngisKahn, bspkrs           
#################################################
:deobfCompileDummyTask
:deobfProvidedDummyTask
:getVersionJson
:extractUserdev
:extractDependencyATs SKIPPED
:extractMcpData SKIPPED
:extractMcpMappings SKIPPED
:genSrgs SKIPPED
:downloadClient SKIPPED
:downloadServer SKIPPED
:splitServerJar SKIPPED
:mergeJars SKIPPED
:deobfMcSRG SKIPPED
:decompileMc FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':decompileMc'.
> GC overhead limit exceeded

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 4 mins 45.151 secs
GC overhead limit exceeded
11:21:56 PM: External task execution finished 'setupDecompWorkspace'.

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to post
Share on other sites

Create a gradle.properties file next to build.gradle (if it doesn't already exist) and add this line to it:

org.gradle.jvmargs=-Xmx2G

 

This tells Gradle to run Java with the

-Xmx2G

argument, which sets Java's maximum heap size to 2 GB (enough to decompile 1.8.9).

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to post
Share on other sites

What do you mean next to the file? In the same place where the build.gradle is in my mod folder right?

 

Yes.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to post
Share on other sites

I'm getting an error while running genIntelliJRuns

 

07:06:21 AM: Executing external task 'genIntellijRuns'...
Error occurred parsing version!
This set of MCP mappings was designed for MC 1.8.8. Use at your own peril.
:genIntellijRuns

BUILD SUCCESSFUL

Total time: 2.579 secs
07:06:24 AM: External task execution finished 'genIntellijRuns'.

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to post
Share on other sites

Also, it doesn't look like that the source code was imported

 

Here is my build.gradle

// For those who want the bleeding edge
buildscript {
    repositories {
        jcenter()
        maven {
            name = "forge"
            url = "http://files.minecraftforge.net/maven"
        }
    }
    dependencies {
        classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT'
    }
}
apply plugin: 'net.minecraftforge.gradle.forge'

/*
// for people who want stable - not yet functional for MC 1.8.8 - we require the forgegradle 2.1 snapshot
plugins {
    id "net.minecraftforge.gradle.forge" version "2.0.2"
}
*/
version = "1.0"
group= "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "modid"

minecraft {
    version = "1.8.9-11.15.1.1731"
    runDir = "run"
    
    // the mappings can be changed at any time, and must be in the following format.
    // snapshot_YYYYMMDD   snapshot are built nightly.
    // stable_#            stables are built at the discretion of the MCP team.
    // Use non-default mappings at your own risk. they may not allways work.
    // simply re-run your setup task after changing the mappings to update your workspace.
    mappings = "stable_20"
    // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
}

dependencies {
    // you may put jars on which you depend on in ./libs
    // or you may define them like so..
    //compile "some.group:artifact:version:classifier"
    //compile "some.group:artifact:version"
      
    // real examples
    //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev'  // adds buildcraft to the dev env
    //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env

    // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
    //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'

    // the deobf configurations:  'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided,
    // except that these dependencies get remapped to your current MCP mappings
    //deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
    //deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev'

    // for more info...
    // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
    // http://www.gradle.org/docs/current/userguide/dependency_management.html

}

processResources
{
    // this will ensure that this task is redone when the versions change.
    inputs.property "version", project.version
    inputs.property "mcversion", project.minecraft.version

    // replace stuff in mcmod.info, nothing else
    from(sourceSets.main.resources.srcDirs) {
        include 'mcmod.info'
                
        // replace version and mcversion
        expand 'version':project.version, 'mcversion':project.minecraft.version
    }
        
    // copy everything else, thats not the mcmod.info
    from(sourceSets.main.resources.srcDirs) {
        exclude 'mcmod.info'
    }
}
idea { module { inheritOutputDirs = true } }

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to post
Share on other sites

But the issue with that is the IDE can't find the source code, as if I never ran the commands at all.. I'm trying out the recommended version also to see if that makes a difference.

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to post
Share on other sites

I highly doubt it's the cause of the issue, but the

idea { module { inheritOutputDirs = true } }

line hasn't been required since this commit in ForgeGradle 2.0.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to post
Share on other sites

I've followed this method to set up IntelliJ IDEA, and it works fine when I build and run the game, it starts up properly with my mod in the game. However, the editor can't locate the packages and says I have errors, but it compiles fine anyway?

35Ugbwr.png

 

I have tried running the setupDecompWorkspace task and refreshed several times, I have also tried redoing the whole process. Even tried removing Gradle cache and redownloaded everything.

Also, there are no red errors inside the gradle sidebar, they're all fine.

Link to post
Share on other sites

That is really strange. Try to do File > Invalidate Caches / Restart > Invalidate and Restart.

 

Well that's funny, been sitting here for like an hour trying to fix this and this little option fixed it in some seconds. You'd think removing the gradle cache would do the same, guess not.

Thanks!

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.