ProtocolLib

3M Downloads

Player can not login if listen to CLIENT.FINISH_CONFIGURATION

tanyaofei opened this issue ยท 1 comments

commented
  • [+] This issue is not solved in a development build

Describe the bug
Showing Internal Exception: java.lang.NullPointerException: type cannot be null' while login in if plugin is listening to PacketType.Configuration.Client.FINISH_CONFIGURATION;

And server log:
[02:19:18 INFO]: com.mojang.authlib.GameProfile@6aa2c128[id=xxxxx-58bf81149365,name=xxx,properties={textures=[Property[name=textures, value=xxxx]]}] lost connection: Internal Exception: java.lang.NullPointerException: type cannot be null

ProtocolLib version
5.2.0-SNAPSHOT

Server Version
Purpur 1.20.2

To Reproduce
Steps to reproduce the behavior:

public class PlayerLoginListener extends PacketAdapter {

    public final static PlayerLoginListener instance = new PlayerLoginListener();

    public PlayerLoginListener() {
        super(Main.getInstance(), PacketType.Configuration.Client.FINISH_CONFIGURATION);
    }

    @Override
    public void onPacketReceiving(PacketEvent event) {
        System.out.println(event);
    }

}

The exception caused before the onPacketReceiving was called

image

commented

image

It seems that the problem is when player send FINISH_CONFIGURATION packet, the protocol changed to PLAY (injector.getCurrentProtocol()), but the packet type definintion is CONFIGURATION, can not create the right PacketContainer