ProtocolLib

3M Downloads

Error: ProtocolLibrary.getProtocolManager() returns null

LouisBillaut opened this issue ยท 0 comments

commented

Describe the bug
ProtocolLibrary.getProtocolManager() returns null.

To Reproduce
Here is my build.graddle

dependencies {
    compileOnly("io.papermc.paper:paper-api:1.21.6-R0.1-SNAPSHOT")
    compileOnly("net.luckperms:api:5.5")
    compileOnly("com.comphenix.protocol:ProtocolLib:5.3.0")
}

tasks {
    runServer {
        minecraftVersion("1.21.7")
        downloadPlugins {
            url("https://download.luckperms.net/1594/bukkit/loader/LuckPerms-Bukkit-5.5.9.jar")
            url("https://ci.dmulloy2.net/job/ProtocolLib/753/artifact/build/libs/ProtocolLib.jar")
        }
    }
}

My plugin.yml contains:

depend: [LuckPerms,ProtocolLib]

in the onEnable() of my plugin, i'm doing:

Plugin protocolLib = Bukkit.getPluginManager().getPlugin("ProtocolLib");
        if (protocolLib != null) {
            getLogger().info("Version of ProtocolLib : " + protocolLib.getDescription().getVersion());
        }


        ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();
        getLogger().info("protocolManager = " + protocolManager);

I got these logs:
[16:35:09 INFO]: [...] Version of ProtocolLib : 5.4.0-SNAPSHOT-753 [16:35:09 INFO]: [...] protocolManager = null

Could you help me please ?