Solved ProtocolLibrary.getProtocolManager returns null

Discussion in 'Plugin Development' started by Sheepposu, May 24, 2021.

  1. Offline

    Sheepposu

    I can't figure out why it's returning null. I get the manager in onEnable and create a ProtocolHandler object with that (A class I made for handling the ProtocolManager). I also tried getting the manager in the ProtocolHandler's init method, but it still returned null.
    Code:
        @Override
        public void onEnable(){
            ProtocolManager manager = ProtocolLibrary.getProtocolManager();
            System.out.println(manager);
            protocolHandler = new ProtocolHandler(this, manager);
            protocolHandler.addPacketListener(PacketType.Play.Client.UPDATE_SIGN, new onClientUpdateSign());
        }
    I also have the depend in plugin.yml, the ProtocolLib plugin in my plugins folder, and the dependency in my pom.xml file.
    Code:
    depend: [ProtocolLib]
    Code:
        <dependency>
          <groupId>com.comphenix.protocol</groupId>
          <artifactId>ProtocolLib</artifactId>
          <version>4.6.0</version>
        </dependency>
    Thanks in advance for any help!

    https://www.spigotmc.org/threads/protocollibrary-getprotocolmanager-returns-null.507594/ this fixed my problem

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 24, 2021

Share This Page