[BUG] [1.12.2] Crash when trying to run the mod from a project
ANightDazingZoroark opened this issue ยท 12 comments
Description
i'm not sure if anyone else has had this before or if i'm missing something, but i've been trying to add some type of integration w/ shouldersurfing to an upcoming mod i'm making atm. problem is, when i add the mod to my project, the game crashes, and all i have is this weird crash report where its trying to use Vec3d as a Map when trying to render entities.
I've tried on another fresh clean project that only has one initialize class and it still happens there too. I also tried adding it as a dependency to the build.gradle
via whats written on the wiki just to see and the same crash log shows up
Steps to Reproduce
- Make a new workspace for a Java mod for 1.12.2 and run it, then close
- Go to
run/mods
and put the.jar
for the mod there - Open or make a new world and spawn in a mob
Regardless of whether or not its vanilla or modded it will cause the game to crash
Expected Behavior
For the game to run normally as expected, without crashes
Screenshots
No response
Game Logs
https://gist.github.com/ANightDazingZoroark/cfe91e5d378998dea6eba78f6112ca9f
Other Mods
No response
Additional Information
No response
You can get it working the following way, using the example mod provided with the forge mdk:
OS: Windows 10 (New VM)
Java: Azul Zulu 8.72.0.17
Forge MDK: 14.23.5.2860
Gradle: 7.4
Place ShoulderSurfingDummy.jar from the ShoulderSurfing GitHub repository (branch 1.12.2) in run/mods
within your project.
build.gradle
buildscript {
repositories {
maven {
url = 'https://files.minecraftforge.net/maven'
}
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
}
}
repositories {
maven {
url = "https://www.cursemaven.com"
content {
includeGroup "curse.maven"
}
}
}
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 = '1.0'
group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'modid'
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
minecraft {
// 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 channel: 'snapshot', version: '20171003-1.12'
mappings channel: 'snapshot', version: '20171003-1.12'
// 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'
}
server {
// 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'
}
}
}
dependencies {
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2860'
// 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'
// These dependencies get remapped to your current MCP mappings
// deobf '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
implementation "curse.maven:shoulder-surfing-reloaded-243190:4745817"
implementation('org.ow2.asm:asm:5.2') {
force = true
}
implementation('org.ow2.asm:asm-analysis:5.2') {
force = true
}
implementation('org.ow2.asm:asm-tree:5.2') {
force = true
}
implementation('org.ow2.asm:asm-util:5.2') {
force = true
}
// This may not be required
implementation("org.spongepowered:mixin:0.8.5") {
exclude module: "commons-io"
exclude module: "guava"
exclude module: "gson"
exclude module: "launchwrapper"
}
}
// Example for how to get properties into the manifest for reading by the runtime..
jar {
manifest {
attributes([
"Specification-Title": "examplemod",
"Specification-Vendor": "examplemodsareus",
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"examplemodsareus",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
// Example configuration to allow publishing using the maven-publish task
// This is the preferred method to reobfuscate your jar file
jar.finalizedBy('reobfJar')
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
//publish.dependsOn('reobfJar')
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
}
}
repositories {
maven {
url "file:///${project.projectDir}/mcmodsrepo"
}
}
}
If it is still not working or you have any further questions, feel free to leave another comment in this issue.
is there some kind of configuration that works for the build.gradle provided by the cleanroom template, as thats the one i've been usin for modding
also forgot to note this but this is the console that shows up when i put the stuff in implementation
and dependencies
in my build.gradle as well as the dummy .jar: https://gist.github.com/ANightDazingZoroark/5fb4151755f871a3cc436a229af09b17
Do not add ShoulderSurfingDummy.jar to the mods folder and add just the following dependency to your build.gradle:
dependencies {
implementation rfg.deobf('curse.maven:shoulder-surfing-reloaded-243190:4745817')
}
weird, it causes a crash, and the crash log is the same as the initial one i posted here
Either SSR is installed twice (either duplicate dependency declaration or a SSR jar is still present in the mods folder) or another mod tries to add the same funtion to the EntityPlayer class as SSR. Can you provide your build.gradle?
Must be a build cache issue. I cloned your repo (213a8b9), uncommented line 127 in build.gradle and ran the following commands:
gradlew setupDecompWorkspace
gradlew runClient
The game launched without issue.
did going near mobs crash the game for u? especially since i've still had problems with this even when i deleted the build and gradle folders and followed what u did, and the crash log's the same as the one i initially posted
Found the error: SSR uses mapping snapshot-20171003-1.12 and your template uses stable-39-1.12. Between those versions, the method name of Vec3d.addVector
has changed to Vec3d.add
. SSR uses it's internal json mappings (which is kind of bad, but also required as there is no way to access the forge mappings this early) to remap it's coremod functionality based on the environment. However, this issue will only happen in a deobfuscated environment. Running runObfClient should not crash the game. I will update SSR to the latest stable mappings version.