The mod I'm updating to 1.13.2 compiles but throws NoSuchMethodError on the first call to Minecraft.getInstance().
java.lang.NoSuchMethodError: net.minecraft.client.Minecraft.getInstance()Lnet/minecraft/client/Minecraft;
I'm running the mod using release 1.13.2-forge-25.0.50.
I'm assuming this is a build issue. My build.gradle is:
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.4'
}
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'com.github.johnrengelman.shadow'
version = "1.13-2-25.0.50"
group = "com.shiny.joypadmod"
archivesBaseName = "JoypadMod"
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
minecraft {
mappings channel: 'snapshot', version: '20180921-1.13'
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 {
joypadmod {
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 {
joypadmod {
source sourceSets.main
}
}
}
}
}
dependencies {
minecraft 'net.minecraftforge:forge:1.13.2-25.0.50'
implementation 'org.lwjgl.lwjgl:lwjgl:2.+'
implementation 'com.github.strikerx3:jxinput:0.8'
}
jar {
manifest {
attributes([
"Specification-Title": "JoypadMod",
"Specification-Vendor": "JoypadMod",
"Specification-Version": "1.13-2-25.0.50", // We are version 1 of ourselves
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"JoypadMod",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
shadowJar {
classifier = ""
dependencies {
include dependency("org.lwjgl.lwjgl:lwjgl:2.+")
include dependency("com.github.strikerx3:jxinput:0.8")
}
}
tasks.build.dependsOn shadowJar
I tried adding reobf to the shadow jar, but the build then fails with a mapping error: "No value has been specified for property 'mappings'." The reobf tasks are as follows:
reobf {
shadowJar {}
}
tasks.build.dependsOn reobfShadowJar