Electroblob's Wizardry

Electroblob's Wizardry

18M Downloads

Crash when creating a minion

Dyskal opened this issue ยท 8 comments

commented

Minecraft version: 1.12.2
Forge version: 14.23.5.2847
Wizardry version: 4.2.11
Environnement: Developpement / Client

Issue details: I want to create a minion with your ISummonedCreature interface but I encountered a problem:
ISummonedCreature have a function named getOwnerId in the source which is named func_184753_b in the class
Idea also want to implement net.minecraft.entity.IEntityOwnable getOwnerId (the function you override in ISummonedCreature getOwnerId)
In result, my code implements 2 getOwnerId (ISummonedCreature and IEntityOwnable) and my game crash

Crash report: https://pastebin.com/M5C5XV33

commented

Ah, I came across this problem while developing the TF spell pack. I'm not entirely sure why it happens, but I ended up fixing it by using maven to specify the dependencies instead of local jar files.

To do this, remove the wizardry jar from libs (or wherever you have it) and modify your build.gradle file to include this:

repositories {
    maven {
        name 'Curseforge Maven'
        url 'https://minecraft.curseforge.com/api/maven/'
    }
}

and this:

dependencies {
    deobfCompile "electroblobs-wizardry:ElectroblobsWizardry:4.2.11:1.12.2"
}

Here's an example from TF spell pack if you're stuck:
https://github.com/Electroblob77/TF-Spell-Pack/blob/master/build.gradle#L48

(note that this has some gradle properties in place of the version numbers, you can do this too if you like)

Hope that helps!

commented

I have this config: (deobfCompile don't work)

repositories {
    maven {
        name 'Curseforge Maven'
        url 'https://minecraft.curseforge.com/api/maven/'
    }
}

dependencies {
    compile "electroblobs-wizardry:ElectroblobsWizardry:4.2.11:MC1.12.2"
}

but it still dont work
The only jar file I have in my repo is the Wizardry sources

commented

You need to use deobfCompile, not compile, or you'll likely have the same problem as before. Can you post your entire build.gradle and the error you're currently getting? And make sure the wizardry source isn't in libs or forge will think it's a mod jar

Edit: You were correct to add MC before the minecraft version, I missed it out by mistake

commented

My build.gradle:

buildscript {
    repositories {
        jcenter()
        maven { url = "https://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 = "0.1-alpha"
group = "fr.tatscher.combatminions"
archivesBaseName = "combatminions"

sourceCompatibility = targetCompatibility = '1.8'
compileJava {
    sourceCompatibility = targetCompatibility = '1.8'
}

minecraft {
    version = "1.12.2-14.23.5.2847"
    runDir = "run"
    mappings = "snapshot_20180814"
}

repositories {
    maven {
        name 'Curseforge Maven'
        url 'https://minecraft.curseforge.com/api/maven/'
    }
}

dependencies {
    //compile "electroblobs-wizardry:ElectroblobsWizardry:4.2.11:MC1.12.2"
    deobfCompile "electroblobs-wizardry:ElectroblobsWizardry:4.2.11:MC1.12.2"
}

processResources {
    inputs.property "version", project.version
    inputs.property "mcversion", project.minecraft.version
    from(sourceSets.main.resources.srcDirs) {
        include 'mcmod.info'
        expand 'version':project.version, 'mcversion':project.minecraft.version
    }
    from(sourceSets.main.resources.srcDirs) {
        exclude 'mcmod.info'
    }
}

The error i get:

Could not find deobf.electroblobs-wizardry:ElectroblobsWizardry:4.2.11.
Searched in the following locations:
  - https://files.minecraftforge.net/maven/deobf/electroblobs-wizardry/ElectroblobsWizardry/4.2.11/ElectroblobsWizardry-4.2.11.pom
  - https://files.minecraftforge.net/maven/deobf/electroblobs-wizardry/ElectroblobsWizardry/4.2.11/ElectroblobsWizardry-4.2.11.jar
  - https://repo.maven.apache.org/maven2/deobf/electroblobs-wizardry/ElectroblobsWizardry/4.2.11/ElectroblobsWizardry-4.2.11.pom
  - https://repo.maven.apache.org/maven2/deobf/electroblobs-wizardry/ElectroblobsWizardry/4.2.11/ElectroblobsWizardry-4.2.11.jar
  - https://libraries.minecraft.net/deobf/electroblobs-wizardry/ElectroblobsWizardry/4.2.11/ElectroblobsWizardry-4.2.11.pom
  - https://libraries.minecraft.net/deobf/electroblobs-wizardry/ElectroblobsWizardry/4.2.11/ElectroblobsWizardry-4.2.11.jar
  - https://minecraft.curseforge.com/api/maven/deobf/electroblobs-wizardry/ElectroblobsWizardry/4.2.11/ElectroblobsWizardry-4.2.11.pom
  - https://minecraft.curseforge.com/api/maven/deobf/electroblobs-wizardry/ElectroblobsWizardry/4.2.11/ElectroblobsWizardry-4.2.11.jar
  - file:/C:/Users/Dyskal/.gradle/caches/minecraft/deobfedDeps/deobf/electroblobs-wizardry/ElectroblobsWizardry/4.2.11/ElectroblobsWizardry-4.2.11.pom
  - file:/C:/Users/Dyskal/.gradle/caches/minecraft/deobfedDeps/deobf/electroblobs-wizardry/ElectroblobsWizardry/4.2.11/ElectroblobsWizardry-4.2.11.jar
  - file:/C:/Users/Dyskal/.gradle/caches/minecraft/net/minecraftforge/forge/1.12.2-14.23.5.2847/snapshot/20180814/ElectroblobsWizardry-4.2.11.jar
  - file:/C:/Users/Dyskal/.gradle/caches/minecraft/net/minecraftforge/forge/1.12.2-14.23.5.2847/snapshot/20180814/ElectroblobsWizardry.jar
Required by:
    project :

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

(My project is located at Addon-Wizardry)

commented

Okay, did a bit of trial and error and the actual address you want maven to point to is: https://minecraft.curseforge.com/api/maven/deobf/electroblobs-wizardry/ElectroblobsWizardry/4.2.11/ElectroblobsWizardry-4.2.11-MC1.12.2.jar

According to the curseforge API documentation, the classifier electroblobs-wizardry:ElectroblobsWizardry:4.2.11:MC1.12.2 should point to that location when used with deobfCompile. For some reason your forgegradle has decided to completely ignore the :MC1.12.2 bit, chances are it somehow hasn't refreshed (I can't say I'm surprised, I've had a lot of problems with it myself).

If you're using IntelliJ IDEA, I can normally get it to work by re-running gradlew setupDecompWorkspace, restarting IDEA, then refreshing the gradle project again.

If all else fails, the link above will download the deobf version directly so you might be able to set it up locally with that.

commented

I had the same problem while making a spell addon too.

but, I needed to put this in the maven:
https://minecraft.curseforge.com/api/maven/deobf/
instead of
https://minecraft.curseforge.com/api/maven/deobf/electroblobs-wizardry/ElectroblobsWizardry/4.2.11/ElectroblobsWizardry-4.2.11-MC1.12.2.jar

I got it working here, thanks.

commented

Ah I wasn't totally clear there sorry, what I meant by 'the actual address you want maven to point to' was the url field plus the classifier that comes after deobfCompile, not just the url. It's interesting that you only got it to work with https://minecraft.curseforge.com/api/maven/deobf/, I would have thought https://minecraft.curseforge.com/api/maven/ includes the deobf bit (at least, it worked for me). I guess that must be what I had wrong.

I'll leave this thread open for now, if anyone has any other useful information then please do share it here. I'll also try and get the development tutorial updated with a step-by-step for this at some point soon.

commented

The tutorial now has a walkthrough of how to set up maven so I'm going to close this.