ProtocolLib

3M Downloads

Advancement Wrapper - Null Pointer

brettsaunders21 opened this issue ยท 1 comments

commented

I created a simple test program to just get advancements when they are sent, but it just throws a null pointer?

Error Log

    manager.addPacketListener(new PacketAdapter(Craftory.plugin, ListenerPriority.NORMAL,
        Server.ADVANCEMENTS) {
      @Override
      public void onPacketSending(PacketEvent event) {
        //Wrap Packet
        PacketContainer packetContainer = event.getPacket();
        WrapperPlayServerAdvancements playServerAdvancements =
            new WrapperPlayServerAdvancements(packetContainer);

        //Get advancements
        Optional<Map<MinecraftKey, SerializedAdvancement>> advancementOptional =
            playServerAdvancements.getAdvancements();
      }
    });`


commented

I thought to post here this exact problem, but I see for 15 days you didn't receive a reply,
so I'll give up on the idea to use protocolLib sadly...