Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.15.2][Resolved] Embedded Jar not Extracted


Papa_Prime
 Share

Recommended Posts

Hello, this is how I embed the jar using my buildscript

buildscript {
    repositories {
        maven { url = 'https://files.minecraftforge.net/maven' }
        maven {
            url = "https://repo.spongepowered.org/maven"
        }
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
        classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
    }
}

import net.minecraftforge.gradle.common.task.SignJar
import groovy.json.JsonSlurper
import groovy.json.JsonOutput

plugins {
    id 'org.spongepowered.plugin' version '0.6'
    id 'com.github.johnrengelman.shadow' version '1.2.4'
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'

version = '1.0'
group = 'net.papaprime.papacore'
archivesBaseName = 'papacore'

sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'

repositories {
    jcenter()
    maven {
        name = "spongepowered"
        url = "https://repo.spongepowered.org/maven"
    }
}

configurations {
    inJar
}
configurations.compile.extendsFrom(configurations.inJar)


minecraft {

    mappings channel: 'snapshot', version: '20200514-1.15.1'

    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 {
                papacore {
                    source sourceSets.main
                }
            }
        }

        server {
            workingDirectory project.file('run')

            property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'

            property 'forge.logging.console.level', 'debug'

            mods {
                papacore {
                    source sourceSets.main
                }
            }
        }

        data {
            workingDirectory project.file('run')

            property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'

            property 'forge.logging.console.level', 'debug'

            args '--mod', 'papacore', '--all', '--output', file('src/generated/resources/')

            mods {
                papacore {
                    source sourceSets.main
                }
            }
        }
    }
}

dependencies {
    minecraft 'net.minecraftforge:forge:1.15.2-31.2.8'
    // For more info...
    // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
    // http://www.gradle.org/docs/current/userguide/dependency_management.html

    inJar("org.spongepowered:mixin:0.8")
}

jar {
    manifest {
        attributes([
                "TweakClass": "org.spongepowered.asm.launch.MixinTweaker",
                "TweakOrder": 0,
                "MixinConfigs": "mixins.papacore.json",
            "Specification-Title": "papacore",
            "Specification-Vendor": "papacoresareus",
            "Specification-Version": "1", // We are version 1 of ourselves
            "Implementation-Title": project.name,
            "Implementation-Version": "${version}",
            "Implementation-Vendor" :"papacoresareus",
            "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
            "ContainedDeps": "mixin-0.8.jar"
        ])
    }
    from(configurations.inJar) {
        into 'META-INF/libraries'
    }
}

task signJar(type: SignJar, dependsOn: jar) {

    // findProperty allows us to reference the property without it existing.
    // Using project.propName would cause the script to fail validation if
    // the property did not exist.
    keyStore = project.findProperty('keyStore')
    alias = project.findProperty('keyStoreAlias')
    storePass = project.findProperty('keyStorePass')
    keyPass = project.findProperty('keyStoreKeyPass')
    inputFile = jar.archivePath
    outputFile = jar.archivePath
}

build.dependsOn signJar

jar.finalizedBy('reobfJar')

publishing {
    publications {
        mavenJava(MavenPublication) {
            artifact jar
        }
    }
    repositories {
        maven {
            url "file:///${project.projectDir}/mcmodsrepo"
        }

    }
}

The packaging seems fine, no errors are thrown and the files are successfully signed. But when I load it outside of the dev environment it crashes with this at the start suggesting that the library was not in fact extracted:

java.lang.NoClassDefFoundError: org/spongepowered/asm/launch/MixinBootstrap
[09Jun2020 19:22:42.125] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at net.papaprime.papacore.asm.TransformationService.initialize(TransformationService.java:31)
[09Jun2020 19:22:42.126] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.TransformationServiceDecorator.onInitialize(TransformationServiceDecorator.java:68)
[09Jun2020 19:22:42.126] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.TransformationServicesHandler.lambda$initialiseTransformationServices$7(TransformationServicesHandler.java:107)
[09Jun2020 19:22:42.126] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.TransformationServicesHandler$$Lambda$85/182531396.accept(Unknown Source)
[09Jun2020 19:22:42.126] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.util.HashMap$Values.forEach(HashMap.java:972)
[09Jun2020 19:22:42.127] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.TransformationServicesHandler.initialiseTransformationServices(TransformationServicesHandler.java:107)
[09Jun2020 19:22:42.127] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.TransformationServicesHandler.initializeTransformationServices(TransformationServicesHandler.java:59)
[09Jun2020 19:22:42.128] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.Launcher.run(Launcher.java:75)
[09Jun2020 19:22:42.128] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.Launcher.main(Launcher.java:65)
[09Jun2020 19:22:42.131] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: Caused by: java.lang.ClassNotFoundException: org.spongepowered.asm.launch.MixinBootstrap
[09Jun2020 19:22:42.132] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: 	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
[09Jun2020 19:22:42.132] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[09Jun2020 19:22:42.132] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[09Jun2020 19:22:42.132] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: 	... 9 more

I have searched for the issue with dependency extraction but I was not successful. Any help would be appreciated

Edited by Papa_Prime
Link to comment
Share on other sites

Fair, I will begin working on the addition to forge then.

Edit: This will need far more changes to be convenient. I understand why nobody has added this as a feature of forge yet. Will try to find another way to mess with UseActions

Edited by Papa_Prime
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Hello, I am trying to play Minecraft with a friend on a server but I need forge for it and it isn't starting. It just says this mesage: Memory Heap: 64 / 2048 MB (3,1%)   OffHeap: 36 MB It also doesn't tell me any bug reports. Please tell me how to fix it.
    • Don't be silly. A script kiddie is capable of basic copy pasting. I can't even do that. However, one more thing to add. How do you connect the registered FlowingFluidBlock, to your actual FluidBlock.class? I wasn't aware that you can actually customize the FlowingFluidBlock RegistryObject(or any other RegistryObject in that regard). Do it like that, and take info from the vanilla FluidBlocks how to build your FluidBlock.class accordingly: Change that...         public static final RegistryObject<FlowingFluidBlock> OIL_BLOCK = MatLibRegister.BLOCKS.register("crudeoil",             () -> new FlowingFluidBlock(() -> MatLibFluidOil.OIL_FLUID.get(), AbstractBlock.Properties.create(MATOIL)                     .doesNotBlockMovement().hardnessAndResistance(100f).noDrops()));           ...to that...         public static final RegistryObject<MyCustomFluidBlock> OIL_BLOCK = MatLibRegister.BLOCKS.register("crudeoil",             () -> new MyCustomFluidBlock(() -> MatLibFluidOil.OIL_FLUID.get(), AbstractBlock.Properties.create(MATOIL)                     .doesNotBlockMovement().hardnessAndResistance(100f).noDrops()));   ...and name your FluidBlock MyCustomFluidBlock.class. As far as I understand you do not want to extend to FlowableFluidBlock, but to FlowableFluid. I've yet to understand why, because in the past a fluid block, was still a block. It seems like it is now an "in between" thingy, or no longer a block at all. I hope someone of the wizards can spread some wisdom on that? And if it's just to ease the tinkering...👍 Edit: If someone wants more learning material, I'd recommend the TechReborn FlowableFluid.class, and their actual Fluid.class(Fabric only, so lots of adaptions needed, but good for getting an idea of structure), or PneumaticCraft(Forge). Notice they seem to be on 1.16.5 or even 1.17.1, but the code is compiling fine and dandy with minor adaptions(for 1.17.1 only?). You'd quickly find traces on how to "adapt" by highlighting methods/fields/etc., and open the declaration. Trouble starts really if references aren't public, because then you have to @Override in a custom.class. Which is something I've yet to learn as well. In the past, for 1.7(yes, that's 2013), it looked something like that:
    • just the error: https://pastebin.com/8duvMgPg debug.log: https://gist.github.com/RVOtakuMike/4e84ac2b090408a9dd8defeddbc96c24 latest.log: https://gist.github.com/RVOtakuMike/44f1dc0e7a52696c530136d51a619dfd World does load in single player when i transferred it over, though it said there were errors in the datapacks?? Then made me click "Safe mode". I wonder what i did wrong... any help is appreciated. Ive run minecraft (forge) servers for years and never had issues with save/load. (Though I am new to 1.16)
    • please,I need help and want to know why.I am using IntelliJ
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.