TriumphTeam / triumph-gui

Simple lib to create inventory GUIs for Bukkit platforms.
MIT License
330 stars 57 forks source link

java.lang.NoClassDefFoundError: net/kyori/adventure/text/Component #76

Closed ZaksenCode closed 2 years ago

ZaksenCode commented 2 years ago

what is that problem? i'am import that, but console send me this, when i try to open gui

version is 1.18.2

image

DerSimeon commented 2 years ago

Can you provide your pom.xml/build.gradle(.kts)?

ZaksenCode commented 2 years ago
plugins {
    id 'java'
    id "com.github.johnrengelman.shadow" version "7.1.1"
}

shadowJar {
    relocate("dev.triumphteam.gui", "zaksen.cave.guis.gui")
}

group = 'zaksen.cave'
version = '0.1'

repositories {
    mavenCentral()
    maven {
        name = 'spigotmc-repo'
        url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
    }
    maven {
        name = 'sonatype'
        url = 'https://oss.sonatype.org/content/groups/public/'
    }
}

dependencies {
    compileOnly 'org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT'
    implementation "dev.triumphteam:triumph-gui:3.1.2"
}

def targetJavaVersion = 17
java {
    def javaVersion = JavaVersion.toVersion(targetJavaVersion)
    sourceCompatibility = javaVersion
    targetCompatibility = javaVersion
    if (JavaVersion.current() < javaVersion) {
        toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
    }
}

tasks.withType(JavaCompile).configureEach {
    if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
        options.release = targetJavaVersion
    }
}

processResources {
    def props = [version: version]
    inputs.properties props
    filteringCharset 'UTF-8'
    filesMatching('plugin.yml') {
        expand props
    }
}
DerSimeon commented 2 years ago

Since you are using spigot you have 2 options. Either manually include kyori or use paper rather then spigot

ZaksenCode commented 2 years ago

how i can include kyori? i doesn't want use paper, because i need bungeecord

iGabyTM commented 2 years ago

Can you provide us the full error? @FCKJohni adventure is provided by triumph-gui

DerSimeon commented 2 years ago

https://docs.adventure.kyori.net/getting-started.html

DerSimeon commented 2 years ago

Can you provide us the full error? @FCKJohni adventure is provided by triumph-gui

Isn't it just compileOnly?

ZaksenCode commented 2 years ago

Can you provide us the full error? @FCKJohni adventure is provided by triumph-gui image

server doesn't crush, but console send this

iGabyTM commented 2 years ago

Can you provide us the full error? @FCKJohni adventure is provided by triumph-gui

Isn't it just compileOnly?

No

LichtHund commented 2 years ago

The issue here is how you're building the project, you need to build with the shadowJar task. I also suggest you relocate adventure as well, use net.kyori to zaksen.cave.kyori or something like that.

And as for the paper comment, you can use Bungeecord with Paper as well.

ZaksenCode commented 2 years ago

The issue here is how you're building the project, you need to build with the shadowJar task. I also suggest you relocate adventure as well, use net.kyori to zaksen.cave.kyori or something like that.

And as for the paper comment, you can use Bungeecord with Paper as well.

oh yes? hmm

ZaksenCode commented 2 years ago

something like this? image

ZaksenCode commented 2 years ago

oh, that work! thanks!