Skip to content
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

PacketAdapter #3342

Open
Kai-Denzel-Jane opened this issue Jan 4, 2025 · 7 comments
Open

PacketAdapter #3342

Kai-Denzel-Jane opened this issue Jan 4, 2025 · 7 comments

Comments

@Kai-Denzel-Jane
Copy link

Make sure you're doing the following

  • [Y] You're using the latest build for your server version
  • [~] This isn't an issue caused by another plugin
  • [Y] You've checked for duplicate issues
  • [Y] You didn't use /reload

Describe the question
Why am I getting the following error when I have ProtocolLib in the Projects dependencies and the JAR file is in the plugins folder:

[19:27:29 ERROR]: Error occurred while enabling ClientInfo v1.0 (Is it up to date?) java.lang.NoClassDefFoundError: com/comphenix/protocol/events/PacketAdapter at java.base/java.lang.ClassLoader.defineClass1(Native Method) ~[?:?] at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1027) ~[?:?] at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150) ~[?:?] at io.papermc.paper.plugin.entrypoint.classloader.PaperSimplePluginClassLoader.findClass(PaperSimplePluginClassLoader.java:103) ~[purpur-1.21.4.jar:1.21.4-2376-4bf1b98] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:593) ~[?:?] at io.papermc.paper.plugin.entrypoint.classloader.PaperPluginClassLoader.loadClass(PaperPluginClassLoader.java:118) ~[purpur-1.21.4.jar:1.21.4-2376-4bf1b98] at io.papermc.paper.plugin.entrypoint.classloader.PaperPluginClassLoader.loadClass(PaperPluginClassLoader.java:107) ~[purpur-1.21.4.jar:1.21.4-2376-4bf1b98] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?] at ClientInfo-1.0-SNAPSHOT.jar/net.kaijane.clientInfo.ClientInfo.onEnable(ClientInfo.java:15) ~[ClientInfo-1.0-SNAPSHOT.jar:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:288) ~[purpur-api-1.21.4-R0.1-SNAPSHOT.jar:?] at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:202) ~[purpur-1.21.4.jar:1.21.4-2376-4bf1b98] at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:109) ~[purpur-1.21.4.jar:1.21.4-2376-4bf1b98] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:520) ~[purpur-api-1.21.4-R0.1-SNAPSHOT.jar:?] at org.bukkit.craftbukkit.CraftServer.enablePlugin(CraftServer.java:669) ~[purpur-1.21.4.jar:1.21.4-2376-4bf1b98] at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:618) ~[purpur-1.21.4.jar:1.21.4-2376-4bf1b98] at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:772) ~[purpur-1.21.4.jar:1.21.4-2376-4bf1b98] at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:534) ~[purpur-1.21.4.jar:1.21.4-2376-4bf1b98] at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:369) ~[purpur-1.21.4.jar:1.21.4-2376-4bf1b98] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1251) ~[purpur-1.21.4.jar:1.21.4-2376-4bf1b98] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:344) ~[purpur-1.21.4.jar:1.21.4-2376-4bf1b98] at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?] Caused by: java.lang.ClassNotFoundException: com.comphenix.protocol.events.PacketAdapter at io.papermc.paper.plugin.entrypoint.classloader.PaperPluginClassLoader.loadClass(PaperPluginClassLoader.java:146) ~[purpur-1.21.4.jar:1.21.4-2376-4bf1b98] at io.papermc.paper.plugin.entrypoint.classloader.PaperPluginClassLoader.loadClass(PaperPluginClassLoader.java:107) ~[purpur-1.21.4.jar:1.21.4-2376-4bf1b98] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?] ... 21 more

API method(s) used
PacketAdapter

Expected behavior
My plugin sees ProtocolLib and its classes resulting in it not failing to enable the plugin

Code
https://github.com/Kai-Denzel-Jane/ClientInfo

@Runkang10
Copy link

Aren't you shading ProtocolLib?

@Runkang10
Copy link

Your repo is not available so we cannot see your source code.

@Kai-Denzel-Jane
Copy link
Author

Your repo is not available so we cannot see your source code.

Sorry about that its now public forget making repos from IntelliJ are Private by default

@Runkang10
Copy link

Set ProtocolLib as compileOnly dependency.

@Runkang10
Copy link

repositories {
    maven { url "https://repo.dmulloy2.net/repository/public/" }
}

dependencies {
    compileOnly 'com.comphenix.protocol:ProtocolLib:5.1.0'
}

@MarkManFlame55
Copy link

MarkManFlame55 commented Jan 9, 2025

its happening the same for me with every packet listener. NoClassDefFound and my plugin gets unloaded. I have ProtoclLib as a Dependency on my build.gradle and installed on my server, and it keeps throwing me that exception.

@Runkang10
Copy link

Also check if ProtocolLib supports the current server version that you're using.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants