Jump to content

Forge in IntelliJ and mod help


chillthuggin1

Recommended Posts

I want to make a machine that uses Mcjty's RF power in my mod but how do i implement RF into a block? In intelliJ? running the forge 1.12 MDK is fine but when I add the example mod files from McJty's video it keeps giving me errors.

 

buildscript {
    repositories {
        jcenter()

        maven { url = "https://files.minecraftforge.net/maven" ; url = "http://maven.covers1624.net" }
    }

    dependencies {
        classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
        deobfCompile "cofh:RedstoneFlux:1.12-2.1.0.6-universal:universal"
    }
}
apply plugin: 'net.minecraftforge.gradle.forge'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.


version = "1.0"
group = "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "modid"

sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
compileJava {
    sourceCompatibility = targetCompatibility = '1.8'
}

minecraft {
    version = "1.12.2-14.23.5.2824"
    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 always work.
    // simply re-run your setup task after changing the mappings to update your workspace.
    mappings = "snapshot_20171003"
    // 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 except the mcmod.info
    from(sourceSets.main.resources.srcDirs) {
        exclude 'mcmod.info'
    }
}

 

Edited by chillthuggin1
Added code
Link to comment
Share on other sites

I would do these things first, if you haven't already...
1. Make a mod that does nothing and confirm it works (shows up in the mod list in-game)

2. Make a basic block that does nothing

3. Make the block look how you want

4. Add the "Redstone Flux" mod as a dependency, and make sure it shows up correctly in the mod list in-game

 

Ie. get all the basics out of the way first before trying to add any cross-mod functionality.  Once you have all these things done (one at a time!) then your foundations are in place to start tinkering with RF blocks (unless I missed something)

Link to comment
Share on other sites

7 minutes ago, Laike_Endaril said:

I would do these things first, if you haven't already...
1. Make a mod that does nothing and confirm it works (shows up in the mod list in-game)

2. Make a basic block that does nothing

3. Make the block look how you want

4. Add the "Redstone Flux" mod as a dependency, and make sure it shows up correctly in the mod list in-game

 

Ie. get all the basics out of the way first before trying to add any cross-mod functionality.  Once you have all these things done (one at a time!) then your foundations are in place to start tinkering with RF blocks (unless I missed something)

Ok do I just download the jar file or is their an API for RedstoneFlux?

I already added 

repositories {
    maven {
        name = "CoFH Maven"
        url = "http://maven.covers1624.net"
    }
}

dependencies {
    deobfCompile "cofh:RedstoneFlux:1.12-2.0.0.1:universal"
}

to the build.gradle like CoFH Team and KingLemming said.

Link to comment
Share on other sites

That looks fine to me at a glance.  Run the game from your dev environment and see if the redstone flux mod shows up.

Have you already gotten a basic block working as well?

 

Edit: When I say "that looks fine", I mean that if the gradle repositories and dependencies are working correctly (not mistyped, etc), you should not need anything else related to RF, afaik.  If you wanted to use the jar file as a dependency *instead*, you could do that, but I wouldn't do both at the same time

Edited by Laike_Endaril
Link to comment
Share on other sites

If you're trying to add someone else's block, I suggest not doing so.  It can lead to more confusion than making your own.  I'd find a simple block tutorial first.  Make sure it extends Block directly and not BlockBase.

 

If anyone sees this and can suggest a good block tutorial, that would be great.  I mostly do game mechanic mods.

Link to comment
Share on other sites

I added Redstone Flux to the mods folder and it gives this error when I run it.

 

Could not find method deobfCompile() for arguments [cofh:RedstoneFlux:1.12-2.1.0.6-universal:universal] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Link to comment
Share on other sites

Also, don’t use RF, use FE, forges built in energy system. It’s optional to use, but it’s the replacement for RF and increases compatibility between mods

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.