• Recently Browsing

    No registered users viewing this page.

  • Posts

    • I have multiple shadowed dependencies in my mod, and it seems that something isn't working correctly here...   When I look in the jar file, all of my dependencies are properly relocated and included, but I seem to have an issue with Minecraft recognizing it as a mod. The error says  Very strange. The debug.log shows the mod failed to load because of a   Here's my build.gradle if that will be any help. buildscript { repositories { maven { url = 'https://files.minecraftforge.net/maven' } maven { url = "https://plugins.gradle.org/m2/" } jcenter() mavenCentral() } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true } } plugins { id "com.github.johnrengelman.shadow" version "2.0.4" } apply plugin: 'java' apply plugin: 'net.minecraftforge.gradle' apply plugin: 'eclipse' apply plugin: 'maven-publish' version = '1.0' group = 'com.mod.mod' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'mod' sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. //Print out JVM information so that we know what version is running. Extreamly useful for people to know when helping you. println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch')) 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: '20200514-1.15.1' // 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', 'examplemod', '--all', '--output', file('src/generated/resources/') mods { examplemod { source sourceSets.main } } } } } project.tasks.build.dependsOn project.tasks.shadowJar repositories { jcenter() } configurations { provided compile.extendsFrom provided } dependencies { minecraft 'net.minecraftforge:forge:1.15.2-31.2.36' compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.11.2' compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.2' compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.141.59' shadow group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.11.2' shadow group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.2' shadow group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.141.59' } shadowJar { configurations = [project.configurations.shadow] classifier '' relocate('org.apache', 'com.mod.apache') relocate('com.google', 'com.mod.google') } processResources { inputs.property "version", project.version inputs.property "mcversion", "1.15.2-31.2.36" from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' expand 'version':project.version, 'mcversion': "1.15.2-31.2.36" } from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } } jar { manifest { attributes([ "Specification-Title": "mod", "Specification-Vendor": "mod", "Specification-Version": "1", // We are version 1 of ourselves "Implementation-Title": project.name, "Implementation-Version": "${version}", "Implementation-Vendor" :"mod", "Multi-Release": 'true', "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), "ContainedDeps": "byte-buddy-1.8.15.jar client-combined-3.141.59.jar commons-exec-1.3.jar guava-25.0-jre.jar okhttp-3.11.0.jar okio-1.14.0.jar" ]) } } // 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" } } }   My guess is that it is an error with the "minecraft" dependancy, I just don't know where to start on fixing it.   Thanks in advance!
    • You've demystified this a little bit for me and pointed out a good note - if I want to duplicate existing items, since I have the source code I can technically copy and paste it into my own class to clone the complete logic. I'll see how that goes.    Thank you!
    • I ran it using the runClient configuration generated by  gradlew genEclipseRuns in the command line.
    • That's odd, I couldn't find anything wrong with the code. could you describe exactly what steps you are taking to run the mod?   also: your group in build.gradle and your main path doesn't follow the convention, seeing that you have a github, you could use that http://maven.apache.org/guides/mini/guide-naming-conventions.html   EDIT: Ideally I would pull the repo to my machine and try running the mod myself, but my weak computer takes 4 hours to decompile mc, So... sorry I can't do that
  • Topics

  • Who's Online (See full list)