Posted February 10, 20187 yr I'm using the discord jda as a dependency for my mod, and I recently had a problem here, but I'm still stuck on combining this new shadow jar with the original jar. For reference, this is the gradle shadow plugin I'm using When I run gradlew build with this in my build.gradle: buildscript { repositories { jcenter() maven { name = "forge" url = "http://files.minecraftforge.net/maven" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT' classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.2' } } apply plugin: 'net.minecraftforge.gradle.forge' apply plugin: 'com.github.johnrengelman.plugin-shadow' apply plugin: 'java' version = "1.0" group= "com.thelagg.laggview" archivesBaseName = "laggview" sourceCompatibility = 1.8 targetCompatibility = 1.8 project.tasks.build.dependsOn project.tasks.shadowJar minecraft { version = "1.8.9-11.15.1.2318-1.8.9" runDir = "run" mappings = "stable_20" } shadowJar { baseName = 'laggview-shadow' classifier = null version = 1.0 configurations = [project.configurations.compile] } repositories { jcenter() } dependencies { //both my dependencies are in the ./libs folder } processResources { inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version from configurations.compile.collect { zipTree it } 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 shadow-jar seems to look good when I open it with luyten (java deobfuscator): The regular jar hasn't changed at all (it still compiles the dependencies, but doesn't shadow them). I've tried putting the shadow jar into my mods folder to try and run that, but it gave me an error that it could not find a method Minecraft.getMinecraft() - the shadowed Jar doesn't obfuscate any of the fields or methods inside it (picture below) laggview-shadow-1.0.jar laggview-1.0.jar So, I'm looking to do either one of 2 things: Obfuscate the shadow jar like I would with the normal jar shadow the normal jar's dependencies I just have no idea how to do either of those things... If anybody could shed some light on the topic, I would appreciate it. Thanks! Edited February 10, 20187 yr by Lagg Hi
February 10, 20187 yr Your post is unreadable on the dark theme, you should use the Tx button to remove the formatting from it. You need to tell ForgeGradle to reobfuscate the shadow JAR, you can see how I do this here. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
February 10, 20187 yr Author 38 minutes ago, Choonster said: Your post is unreadable on the dark theme, you should use the Tx button to remove the formatting from it. You need to tell ForgeGradle to reobfuscate the shadow JAR, you can see how I do this here. Thanks so much, it worked! Hi
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.