Jump to content

Recommended Posts

Posted (edited)

Hey guys,

 

I don't know what I did, but after upgrading my mod to 1.12.2 from 1.12, many things seem to have broken. Here's my steps:

  1. I updated my build.gradle file (you can see it below)
  2. I ran gradlew clean
  3. Ran gradlew setupDecompWorkspace
  4. Ran gradlew eclipse
Spoiler

buildscript {
    repositories {
        jcenter()
        maven { url = "http://files.minecraftforge.net/maven" }
    }
    dependencies {
        classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
    }
}
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.3.0"
group = "com.DragonFerocity.expanded" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "expanded"

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

minecraft {
    version = "1.12.2-14.23.0.2503"
    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'
    }
}

 

Now things are broken.

 

Whenever I run my mod from eclipse, it keeps telling me that every single one of my items are being registered twice

Spoiler

[22:21:08] [main/WARN] [FML]: ****************************************
[22:21:08] [main/WARN] [FML]: * Registry Block: The object Block{expanded:gold_brick} has been registered twice for the same name expanded:gold_brick.
[22:21:08] [main/WARN] [FML]: *  at net.minecraftforge.registries.ForgeRegistry.add(ForgeRegistry.java:288)
[22:21:08] [main/WARN] [FML]: *  at net.minecraftforge.registries.ForgeRegistry.add(ForgeRegistry.java:269)
[22:21:08] [main/WARN] [FML]: *  at net.minecraftforge.registries.ForgeRegistry.register(ForgeRegistry.java:113)
[22:21:08] [main/WARN] [FML]: *  at com.DragonFerocity.expanded.handlers.BlockHandler.initBlocks(BlockHandler.java:1238)
[22:21:08] [main/WARN] [FML]: *  at com.DragonFerocity.expanded.handlers.RegistryHandler.registerBlocks(RegistryHandler.java:18)
[22:21:08] [main/WARN] [FML]: *  at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_5_RegistryHandler_registerBlocks_Register.invoke(.dynamic)...
[22:21:08] [main/WARN] [FML]: ****************************************

...

If I run gradlew build, it tells me that there a variable that I can clearly see doesn't exist:

Spoiler

R:\...\java\com\DragonFerocity\expanded\items\ModHoe.java:40: error: cannot find symbol
        this.speed = material.getDamageVsEntity() + 1.0F;
                             ^
  symbol:   method getDamageVsEntity()
  location: variable material of type ToolMaterial
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

Which is the 7th line in the following code


 public ModHoe(String name, ItemTool.ToolMaterial material)
    {
        this.toolMaterial = material;
        this.maxStackSize = 1;
        this.setMaxDamage(material.getMaxUses());
        this.setCreativeTab(CreativeTabs.TOOLS);
        this.speed = material.getDamageVsEntity() + 1.0F;
        setUnlocalizedName(Ref.MODID + ":" + name);
        setRegistryName(Ref.MODID + ":" + name);
    }

 

As far as I know I didn't change anything significant between upgrading from 1.12.2 from 1.12. I can post more code, or a link to my github if needed.

 

Your help is appreciated.

Edited by DragonFerocity
Posted
9 hours ago, MDW01 said:

I would try removing all the eclipse files and reimporting the project.

Are there eclipse files in the src directory? I couldn't see any.

 

One thing I did try was creating a new project from scratch using forge, then I edited the build.gradle file with the correct info and copied my src folder over to the new project. The same thing occured.

Posted

That says your blocks are being registered twice, not your items.

 

If you look at the end of the initBlocks method:

for(Block block : blockList) {
   event.getRegistry().register(block);
}
for(Block block : blockList) {
   event.getRegistry().register(block);
}

That's why right there, you do that loop twice.

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.