1.16.5 Spigot Maven ProtocolLibrary.getProtocolManager() = null
pioula opened this issue ยท 2 comments
Describe the bug
As in title, when I call ProtocolLibrary.getProtocolManager() its equal null, wherever I am calling it.
To Reproduce
Steps to reproduce the behavior:
- Use spigot 1.16.5
Additional context
My pom.xml looks like this:
<repositories>
<repository>
<id>dmulloy2-repo</id>
<url>https://repo.dmulloy2.net/repository/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>4.6.0</version>
</dependency>
</dependencies>
in plugin.yml I don't have anything related to protocol. I didn't add ProtocolLib.jar file into build path, but as far as I understand thanks to Maven my pom.xml should do the thing.
There is one thing that concern me a bit. When I build my plugin I get those warnings:
ProtocolLib-4.6.0.jar, byte-buddy-1.10.16.jar, MyPlugin-1.0-SNAPSHOT.jar define 1 overlapping resource:
- META-INF/MANIFEST.MF
ProtocolLib-4.6.0.jar, MyPlugin-1.0-SNAPSHOT.jar define 1 overlapping resource:
- plugin.yml
ProtocolLib-4.6.0.jar, byte-buddy-1.10.16.jar define 8 overlapping classes and resources:
- META-INF.versions.9.module-info
- META-INF/LICENSE
- META-INF/NOTICE
- META-INF/licenses/ASM
- META-INF/maven/net.bytebuddy/byte-buddy-dep/pom.properties
- META-INF/maven/net.bytebuddy/byte-buddy-dep/pom.xml
- META-INF/maven/net.bytebuddy/byte-buddy/pom.properties
- META-INF/maven/net.bytebuddy/byte-buddy/pom.xml
maven-shade-plugin has detected that some class files are
present in two or more JARs. When this happens, only one
single version of the class is copied to the uber jar.
Usually this is not harmful and you can skip these warnings,
otherwise try to manually exclude artifacts based on
mvn dependency:tree -Ddetail=true and the above output.
See http://maven.apache.org/plugins/maven-shade-plugin/
Every help would be much appreciate.
I had this same problem. For me, changing the dependency to this (below) fixed it. Though, you should have depend: [ProtocolLib]
in plugin.yml and ProtocolLib.jar should be in the plugins folder.
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
<version>4.6.0</version>
<scope>provided</scope>
</dependency>