-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.RuntimeException: failed to load scoreboard-library implementation #76
Comments
I slightly modified your build.gradle and it appears to work for me plugins {
id 'java'
id 'com.gradleup.shadow' version '8.3.5'
id 'maven-publish'
}
group = 'net.matrixcreations'
version = '1.0.4'
def scoreboardLibraryVersion = "2.2.2"
repositories {
mavenCentral()
maven { url 'https://repo.papermc.io/repository/maven-public/' }
maven { url 'https://papermc.io/repo/repository/maven-public/' }
maven { url 'https://oss.sonatype.org/content/groups/public/' }
maven { url 'https://jitpack.io' }
maven { url 'https://repo.nexomc.com/releases' }
maven { url 'https://repo.extendedclip.com/content/repositories/placeholderapi/' }
maven { url uri('https://repo.codemc.org/repository/maven-public/') }
maven { url uri('https://repo.onarandombox.com/content/groups/public/') }
maven { url 'https://repo.dmulloy2.net/repository/public/' }
maven { url 'https://repo.infernalsuite.com/repository/maven-snapshots/' }
maven { url 'https://repo.rapture.pw/repository/maven-releases/' }
maven { url 'https://repo.lushplugins.org/releases/' }
maven { url = 'https://maven.maxhenkel.de/repository/public' }
}
dependencies {
shadow localGroovy()
shadow gradleApi()
// Compile-only dependencies
compileOnly 'io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT'
compileOnly 'org.projectlombok:lombok:1.18.32'
compileOnly 'org.graalvm.sdk:nativeimage:24.1.1'
compileOnly 'com.mojang:authlib:1.5.25'
compileOnly 'com.nexomc:nexo:0.4.0'
compileOnly 'com.github.LoneDev6:API-ItemsAdder:3.6.3-beta-14'
compileOnly 'me.clip:placeholderapi:2.11.6'
// compileOnly files('MatrixGlidersAPI Build 2a.jar')
// compileOnly files('LoaderAPI.jar')
// compileOnly files('SCore-5.24.12.8.jar')
compileOnly 'com.onarandombox.multiversecore:multiverse-core:4.3.12'
compileOnly 'com.arcaniax:HeadDatabase-API:1.3.2'
// Implementation dependencies
// implementation files('api-2.0.0.jar')
// implementation files('SpectraAPI.jar')
// implementation files('advancedslot-4.1.13.2.jar')
// implementation files('configurablegui-4.1.13.2.jar')
// implementation files('core-4.1.13.2.jar')
// implementation files('pagination-4.1.13.2.jar')
implementation "de.maxhenkel.voicechat:voicechat-api:2.5.27"
implementation "dev.jorel:commandapi-bukkit-shade-mojang-mapped:9.7.0"
implementation 'org.graalvm.sdk:graal-sdk:24.1.1'
implementation 'com.mchange:c3p0:0.10.1'
implementation 'com.github.cryptomorin:XSeries:12.1.0'
implementation 'io.papermc:paperlib:1.0.7'
implementation 'com.github.ItsHarshXD:WorldTemplateAPI:1.0.1'
implementation 'com.google.code.gson:gson:2.11.0'
implementation 'net.megavex:scoreboard-library-api:'+scoreboardLibraryVersion
runtimeOnly 'net.megavex:scoreboard-library-implementation:'+scoreboardLibraryVersion
runtimeOnly 'net.megavex:scoreboard-library-modern:'+scoreboardLibraryVersion+':mojmap'
runtimeOnly 'net.megavex:scoreboard-library-packetevents:'+scoreboardLibraryVersion
implementation 'net.kyori:adventure-api:4.18.0'
implementation 'net.kyori:adventure-text-minimessage:4.18.0'
implementation 'net.kyori:adventure-text-serializer-legacy:4.18.0'
implementation 'net.kyori:adventure-text-serializer-gson:4.18.0'
implementation 'com.github.retrooper:packetevents-spigot:2.7.0'
// Test dependencies
testCompileOnly 'org.projectlombok:lombok:1.18.32'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.32'
annotationProcessor 'org.projectlombok:lombok:1.18.32'
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
def targetJavaVersion = 21
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.release.set(targetJavaVersion)
}
// Configure resource processing
processResources {
def props = [version: version]
inputs.properties props
filteringCharset 'UTF-8'
filesMatching('.yml') {
expand props
}
}
shadowJar {
relocate 'com.cryptomorin.xseries', 'net.matrixcreations.libs.xseries'
relocate 'io.papermc.lib', 'net.matrixcreations.libs.paperlib'
relocate 'net.matrixcreations.worldTemplateAPI', 'net.matrixcreations.libs.templateapi'
relocate 'dev.jorel.commandapi', 'net.matrixcreations.libs.commandapi'
relocate 'com.github.retrooper.packetevents', 'net.matrixcreations.libs.packetevents'
relocate 'net.kyori', 'net.matrixcreations.libs.kyori'
relocate 'net.megavex.scoreboardlibrary', 'net.matrixcreations.libs.scoreboardlibrary'
manifest {
attributes['paperweight-mappings-namespace'] = 'mojang'
}
}
// Build dependencies
tasks.build.dependsOn(shadowJar)
// Task to export JARs
tasks.register('exportJars') {
doLast {
def outputDir = new File('libs')
outputDir.mkdirs()
configurations.each { configuration ->
if (configuration.isCanBeResolved()) {
configuration.resolvedConfiguration.resolvedArtifacts.each { artifact ->
def fileName = "${artifact.moduleVersion.id.group}-${artifact.moduleVersion.id.name}-${artifact.moduleVersion.id.version}.jar"
def srcFile = artifact.file
def destFile = new File(outputDir, fileName)
if (srcFile.exists() && srcFile.name.endsWith('.jar')) {
ant.copy(file: srcFile, toFile: destFile)
println "Copied: $fileName"
}
}
}
}
println "\nAll JARs have been exported to: ${outputDir.absolutePath}"
}
} public class Main extends JavaPlugin implements Listener {
private ScoreboardLibrary sc;
private TeamManager teamManager;
@Override
public void onEnable() {
try {
sc = ScoreboardLibrary.loadScoreboardLibrary(this);
} catch (NoPacketAdapterAvailableException e) {
getServer().getPluginManager().disablePlugin(this);
return;
}
teamManager = sc.createTeamManager();
getServer().getPluginManager().registerEvents(this, this);
}
@Override
public void onDisable() {
teamManager.close();
sc.close();
}
@EventHandler
public void join(PlayerJoinEvent event) {
teamManager.addPlayer(event.getPlayer());
final var team = teamManager.createIfAbsent("what");
team.defaultDisplay().addEntry(event.getPlayer().getName());
team.defaultDisplay().prefix(Component.text("[test] "));
}
@EventHandler
public void quit(PlayerJoinEvent event) {
teamManager.addPlayer(event.getPlayer());
}
} I would need more info about your environment to reproduce error error. |
You appear to be using Mojang mappings so I assume you're only targeting modern versions of Paper and not Spigot. In that case you don't need to shade packetevents, gson, paperlib etc |
Uh I use dynamic plugin loader like https://github.com/AkramLZ/PluginLoader |
Perhaps you should ask the devs of the loader then because the provided build.gradle works fine. Otherwise I need a minimal reproduction example that gets that error |
I don't think so... see this error comes after i edited my build.gradle:
New Build.gradle:
After including the gson depend of adventure this error comes:
This is saying that no net.minecraft.network.chat.Component... |
Try to replace implementation 'net.kyori:adventure-api:4.18.0'
implementation 'net.kyori:adventure-text-minimessage:4.18.0'
implementation 'net.kyori:adventure-text-serializer-legacy:4.18.0'
implementation 'net.kyori:adventure-text-serializer-gson:4.18.0' with: implementation 'net.kyori:adventure-platform-bukkit:4.0.1' If it still doesn't work then provide me with the PaperMC build you're using and your Java version details (java --version) |
Do the adventure needs to be shaded? |
If you're using Paper then no |
This error is coming now:
|
Also remove the |
Currently: I'm not shading adventure into my project. You mean i need to remove adventure implementation from my project? |
Yes, paper has adventure built in |
Still new error:
|
If I had to guess one of your dependencies are causing adventure to still be shaded into your plugin.jar and it's conflicting with Paper's built-in adventure |
Hey there this error is coming up:
Build.gradle file:
The text was updated successfully, but these errors were encountered: