Closed daomephsto closed 3 years ago
Can you check if your jar file contains panelstudio
Hi,thanks for your answer. I decompiled the jar and found this so I guess yeah
Check if you can find mc16 package
no i cant, i guess there is something wrong in my build.gradle file but idk what it is
Idk then
Try using implementation
instead of modImplementation
I changed modImplementation include("com.lukflug:panelstudio-mc16:0.1.9")
for implementation include("com.lukflug:panelstudio-mc16:0.1.9")
and I'm getting the same error. (Builds the jar and launches but crashes when it tries to initialize the clickgui, I can tell because in the logs all stuff is working correctly until I do it, runClient still works fine and doesn't crash)
Maybe make a custom configuration
@RitomG69 I don't know what do you mean with that
`buildscript { repositories { maven { url = 'https://files.minecraftforge.net/maven' } maven { url = 'https://repo.spongepowered.org/repository/maven-public/' } }
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:4.+'
classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle' apply plugin: 'org.spongepowered.mixin'
group = 'me.ritomg' version = '0.2B' archivesBaseName = 'Ananta'
compileJava { sourceCompatibility = targetCompatibility = '1.8' options.encoding = 'UTF-8' }
repositories { maven { url = 'https://repo.spongepowered.org/repository/maven-public/' } maven { url = 'https://impactdevelopment.github.io/maven/' } maven { url = "https://jitpack.io" } maven { url = 'https://lukflug.github.io/maven' } }
minecraft { mappings channel: 'stable', version: '39-1.12' runs { client { workingDirectory project.file('run') property 'fml.coreMods.load', 'me.ritomg.ananta.mixin.CoreMixin' property 'forge.logging.markers', 'REGISTRIES' property 'forge.logging.console.level', 'debug'
mods {
ananta {
source sourceSets.main
}
}
}
server {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
mods {
ananta {
source sourceSets.main
}
}
}
}
}
configurations { //Custom configuration name jarLibs }
dependencies { minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2854'
//use PS with custom configuration
jarLibs('com.lukflug:panelstudio:0.2.0-SNAPSHOT')
jarLibs('com.lukflug:panelstudio-mc12:0.2.0-SNAPSHOT')
// Add everything in jarLibs to implementation (compile)
implementation configurations.jarLibs
}
processResources { inputs.property "version", project.version
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
include 'refmap.ananta.json'
expand 'version':'0.2'
}
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
mixin { defaultObfuscationEnv 'searge' add sourceSets.main, 'refmap.ananta.json' }
jar { manifest { attributes( 'MixinConfigs': 'mixins.ananta.json', 'tweakClass': 'org.spongepowered.asm.launch.MixinTweaker', 'TweakOrder': 0, 'FMLCorePluginContainsFMLMod': 'true', 'FMLCorePlugin': 'me.ritomg.ananta.mixin.CoreMixin', 'ForceLoadAsMod': 'true', ) }
// Copy needed libs to jar
from {
configurations.jarLibs.collect {
it.isDirectory() ? it : zipTree(it)
}
}
}` The jarlibs is a custom Configuration and this works without any problem
I got this error A problem occurred evaluating root project 'TestProject'.
Could not find method jarLibs() for arguments [com.lukflug:panelstudio:0.1.11] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Did you add this? configurations { //Custom configuration name jarLibs }
you don't need shadowjar if you have that
yeah, my build.gradle looks like this rn
plugins {
id 'fabric-loom' version '0.7.27'
id 'maven-publish'
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
minecraft {
}
repositories {
mavenLocal()
mavenLocal()
jcenter()
maven {
url = "https://jitpack.io"
}
maven {
name = 'lukflug'
url = 'https://lukflug.github.io/maven'
}
maven {
url = 'https://repo.spongepowered.org/repository/maven-public/'
}
}
dependencies {
//to change the versions see the gradle.properties file
minecraft ("com.mojang:minecraft:${project.minecraft_version}")
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
jarLibs("com.lukflug:panelstudio:0.1.11")
jarLibs("com.lukflug:panelstudio-mc16:0.1.9")
implementation configurations.jarLibs
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
// 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).configureEach {
it.options.encoding = "UTF-8"
def targetVersion = 8
if (JavaVersion.current().isJava9Compatible()) {
it.options.release = targetVersion
}
}
// 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
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
}
}
jar {
manifest {
attributes(
'MixinConfigs': 'mixins.ananta.json',
'tweakClass': 'org.spongepowered.asm.launch.MixinTweaker',
'TweakOrder': 0,
'FMLCorePluginContainsFMLMod': 'true',
'FMLCorePlugin': 'me.ritomg.ananta.mixin.CoreMixin',
'ForceLoadAsMod': 'true',
)
}
// Copy needed libs to jar
from {
configurations.jarLibs.collect {
it.isDirectory() ? it : zipTree(it)
}
}
}
configurations {
jarLibs
}
// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven
artifact(jar) {
builtBy remapJar
}
artifact("${project.buildDir.absolutePath}/libs/${archivesBaseName}-${project.version}.jar"){
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
}
// select the repositories you want to publish to
repositories {
// uncomment to publish to the local maven
// mavenLocal()
}
}
bro the code i gave is for Forge just add the configuration lines
? the config lines are there
`plugins { id 'fabric-loom' version '0.7.27' id 'maven-publish' }
sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8
archivesBaseName = project.archives_base_name version = project.mod_version group = project.maven_group
minecraft { }
repositories { mavenLocal() mavenLocal() jcenter()
maven {
url = "https://jitpack.io"
}
maven {
name = 'lukflug'
url = 'https://lukflug.github.io/maven'
}
}
configurations { jarLibs }
dependencies { //to change the versions see the gradle.properties file minecraft ("com.mojang:minecraft:${project.minecraft_version}") mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
jarLibs("com.lukflug:panelstudio:0.1.11")
jarLibs("com.lukflug:panelstudio-mc16:0.1.9")
implementation configurations.jarLibs
}
processResources { inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
// 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).configureEach { it.options.encoding = "UTF-8" def targetVersion = 8 if (JavaVersion.current().isJava9Compatible()) { it.options.release = targetVersion } }
// 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 }
jar { from("LICENSE") { rename { "${it}_${project.archivesBaseName}"} } }
jar {
// Copy needed libs to jar
from {
configurations.jarLibs.collect {
it.isDirectory() ? it : zipTree(it)
}
}
}
// configure the maven publication publishing { publications { mavenJava(MavenPublication) { // add all the jars that should be included when publishing to maven artifact(jar) { builtBy remapJar } artifact("${project.buildDir.absolutePath}/libs/${archivesBaseName}-${project.version}.jar"){ builtBy remapJar } artifact(sourcesJar) { builtBy remapSourcesJar } } }
// select the repositories you want to publish to
repositories {
// uncomment to publish to the local maven
// mavenLocal()
}
}`
use this maybe
Getting this now org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':jar'. Caused by: org.gradle.api.InvalidUserCodeException: Entry fabric.mod.json is a duplicate but no duplicate handling strategy has been set. Please refer to https://docs.gradle.org/7.0.2/dsl/org.gradle.api.tasks.Copy.html#org.gradle.api.tasks.Copy:duplicatesStrategy for details.
Hey first use the old build.gradle that had shadowjar then run gradle shadowjar instead of gradle build. See if that fixes
I already tried that before creating this issue
Can confirm this is an issue. Can't find any open source clients that use panelstudio without shadowjar for fabric. I had problems with this in my own client which just resulted in me not using panelstudio for fabric.
Also hi danimania. I also suggest not listening to RitomG unless you want to break your client.
Um tensor? Good joke
wdym good joke lmao
Lol
``Hello, i'm having an issue when trying to initialize the clickgui,i think its a gradle problem. everything works fine on the runClient task but when trying to initialize the client from the jar in the minecraft launcher it crashes with this error: https://pastebin.com/wdqdxha0 This is my build.gradle file:
It works fine in runClient task with panelstudio and it shows up correctly but when building it to jar and launching it it crashes with this error, i checked and deleted the clickgui, then rebuilt the jar and launched and it worked fine again so its probably an issue caused by me importing uncorrectly panelstudio from gradle. would be awesome if you could help me