Jump to content

Recommended Posts

Posted (edited)

Today a weird problem has occurred.

 

I'm using Intellij Idea. I opened my mod project to find various imports were't resolving. Namely:

 

import net.minecraftforge.fml.loading.FMLPaths;

 

FMLPaths is red

 

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

 

LogManager and Logger are red.

 

Then within my script the logger is red, and events on the loading listeners are red. I tried refreshing dependencies, and reimporting the build.gradle to no avail. Even more strangely... if I attempt to run the mod, it works as though nothing were wrong.

 

I opened some of my other mod projects, same thing happens. It's affecting all of them. It appears to exist in the IDE only.

 

 

Additionally, I just opened one of my classes that appeared fine (wasn't highlighted in red in the IDE project tree) and its not showing errors on

 

import net.minecraftforge.eventbus.api.SubscribeEvent;

 

SubscribeEvent is in red.

 

 

Here is my build.gradle in case it helps:

 

 

buildscript {
    repositories {
        maven { url = 'https://files.minecraftforge.net/maven' }
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
    }
}
apply plugin: 'net.minecraftforge.gradle'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
apply plugin: 'maven-publish'


version = modMinecraftVersion + "-" + modVersion;
group = modGroup
archivesBaseName = modFileName + "-" + version;
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.

minecraft {
    mappings channel: mappingsChannel, version: mappingsVersion
    // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
    // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

    // Default run configurations.
    // These can be tweaked, removed, or duplicated as needed.
    runs {
        client {
            workingDirectory project.file('run')

            // Recommended logging data for a userdev environment
            property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'

            // Recommended logging level for the console
            property 'forge.logging.console.level', 'debug'

            mods {
                examplemod {
                    source sourceSets.main
                }
            }
        }

        server {
            workingDirectory project.file('run')

            // Recommended logging data for a userdev environment
            property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'

            // Recommended logging level for the console
            property 'forge.logging.console.level', 'debug'

            mods {
                examplemod {
                    source sourceSets.main
                }
            }
        }

        data {
            workingDirectory project.file('run')

            // Recommended logging data for a userdev environment
            property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'

            // Recommended logging level for the console
            property 'forge.logging.console.level', 'debug'

            args '--mod', 'cerulean', '--all', '--output', file('src/generated/resources/')

            mods {
                examplemod {
                    source sourceSets.main
                }
            }
        }
    }
}

repositories {
    maven {url "http://tehnut.info/maven"}    
}

dependencies {
    minecraft "net.minecraftforge:forge:" + modMinecraftVersion + "-" + modForgeVersion

    // You may put jars on which you depend on in ./libs or you may define them like so..
    compile fg.deobf("mcp.mobius.waila:Hwyla:1.10.6-B67_1.14.4")  
}

// Example for how to get properties into the manifest for reading by the runtime..
jar {
    manifest {
        attributes([
            "Specification-Title": modID,
            "Specification-Vendor": modGroup,
            "Specification-Version": "1", // We are version 1 of ourselves
            "Implementation-Title": project.name,
            "Implementation-Version": "${version}",
            "Implementation-Vendor" : modGroup,
            "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
        ])
    }
}

// Example configuration to allow publishing using the maven-publish task
// we define a custom artifact that is sourced from the reobfJar output task
// and then declare that to be published
// Note you'll need to add a repository here
def reobfFile = file("$buildDir/reobfJar/output.jar")
def reobfArtifact = artifacts.add('default', reobfFile) {
    type 'jar'
    builtBy 'reobfJar'
}
publishing {
    publications {
        mavenJava(MavenPublication) {
            artifact reobfArtifact
        }
    }
    repositories {
        maven {
            url "file:///${project.projectDir}/mcmodsrepo"
        }
    }
}

 

 

My gradle.properties

# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

modID = cerulean
modGroup = com.fizix.cerulean
modVersion = 1.0.0
modFileName = Cerulean
modMinecraftVersion = 1.14.4
modForgeVersion = 28.1.0
mappingsChannel = snapshot
mappingsVersion = 20190916-1.14.3

 

 

And the mods.toml

 

modLoader="javafml"

loaderVersion="[28,)" #mandatory (28 is current forge version)
#issueTrackerURL="http://my.issue.tracker/" #optional

[[mods]]
modId="cerulean"
version = "1.0.0"
displayName="Cerulean"
#updateJSONURL="http://myurl.me/"
displayURL="http://example.com/"
#logoFile="examplemod.png" #optional
credits="Thanks for this example mod goes to Java"
authors="Love, Cheese and small house plants"
description='''
 Description / info
'''

# Dependencies
[[dependencies.cerulean]]
    modId="forge"
    mandatory=true
    versionRange="[28,)"
    ordering="NONE"
    side="BOTH"

[[dependencies.cerulean]]
    modId="minecraft"
    mandatory=true
    versionRange="[1.14.4]"
    ordering="NONE"
    side="BOTH"

 

 

 

Edited by FizixRichard

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.