FabricMC / tiny-remapper

Tiny JAR remapping tool.
GNU Lesser General Public License v3.0
115 stars 65 forks source link

Failed to setup Minecraft, java.lang.RuntimeException: Failed to remap minecraft #103

Closed CaptainRexPL closed 2 years ago

CaptainRexPL commented 2 years ago

When I try to build my mod I get this output: `Starting a Gradle Daemon (subsequent builds will be faster)

Configure project :mod Fabric Loom: 1.0.11 Loom is applying dependency data manually to publications instead of using a software component (from(components["java"])). This is deprecated. Not publishing sources jar as it was not found. Use java.withSourcesJar() to fix.

Deprecated Loom APIs were used in this build, making it incompatible with future versions of Loom. Use Gradle warning modes to control the verbosity of the warnings. FAILURE: Build failed with an exception.

BUILD FAILED in 2m 18s`

loom version: 1.0 yarn-mappings version: yarn_mappings=1.19.2+build.8

":mod" module build.gradle file: `plugins { id 'maven-publish' id 'fabric-loom' version '1.0-SNAPSHOT' id 'com.github.johnrengelman.shadow' version '7.0.0' }

sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17

archivesBaseName = project.archives_base_name version = project.mod_version group = project.maven_group

repositories { mavenLocal() mavenCentral()

}

dependencies { minecraft "com.mojang:minecraft:${project.minecraft_version}" mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" modCompileOnly "net.fabricmc:fabric-loader:${project.loader_version}"

modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

modApi "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

modCompileOnly "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

modCompileOnlyApi "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

modRuntimeOnly "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

modLocalRuntime "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

api group: 'com.collarmc', name: 'pounce', version: "${project.property('pounce.version')}"
api group: 'com.collarmc', name: 'client', version: "${project.property('collar.version')}", classifier: 'full'
implementation group: 'com.goterl', name: 'lazysodium-java', version: "5.1.1"

shadow (group: 'com.collarmc', name: 'pounce', version: "${project.property('pounce.version')}") {
    transitive(false)
}
shadow (group: 'com.collarmc', name: 'client', version: "${project.property('collar.version')}", classifier: 'full') {
    transitive(false)
}

}

// processResources { // inputs.property "version", project.version // filteringCharset "UTF-8" // // filesMatching("fabric.mod.json") { // expand "version": project.version // } // }

processResources { inputs.property "version", project.version duplicatesStrategy = 'include'

from(sourceSets.main.resources.srcDirs) {
    include "fabric.mod.json"
    expand "version": project.version
}

from(sourceSets.main.resources.srcDirs) {
    exclude "fabric.mod.json"
}

}

// ensure that the encoding is set to UTF-8, no matter what the system default is // this fixes some edge cases with special characters not displaying correctly // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html tasks.withType(JavaCompile) { options.encoding = "UTF-8" }

// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task // if it is present. // If you remove this task, sources will not be generated. task sourcesJar(type: Jar, dependsOn: classes) { classifier = "sources" from sourceSets.main.allSource }

shadowJar { configurations = [project.configurations.shadow] enabled = false }

remapJar { input.set shadowJar.archiveFile dependsOn(shadowJar) }

jar {
    from("LICENSE") {
        rename { "${it}_${project.archivesBaseName}" }
    }
}

// configure the maven publication publishing { publications { mavenJava(MavenPublication) { // add all the jars that should be included when publishing to maven artifact(remapJar) { builtBy remapJar } artifact(sourcesJar) { builtBy remapSourcesJar } } }

// select the repositories you want to publish to
repositories {
    // uncomment to publish to the local maven
    // mavenLocal()
}

} `

zybzbk commented 4 months ago

I'm having a problem similar to yours, but I'm using JAVA21.