PanelStudio: ClassNotFoundException when clickgui gets initialized

``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:

plugins {
	id 'fabric-loom' version '0.7.27'
	id 'maven-publish'
	id "com.github.johnrengelman.shadow" version "7.0.0"
}

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'
	}
}

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}"

	implementation include("com.lukflug:panelstudio:0.1.8")
	modImplementation include("com.lukflug:panelstudio-mc16:0.1.9")


	implementation include('club.minnced:java-discord-rpc:2.0.1')
}

shadowJar{
	dependencies{
		include(dependency("com.lukflug:panelstudio"))
		include(dependency("com.lukflug:panelstudio-mc16"))
		include(dependency('club.minnced:java-discord-rpc:2.0.1'))
	}
}

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}"}
	}
}

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

java {
	withSourcesJar()
}

// 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()
	}
}

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

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 26 (15 by maintainers)

Most upvoted comments

Um tensor? Good joke