GeyserMC / MCProtocolLib

A library for communication with a Minecraft client/server.
MIT License
724 stars 200 forks source link

Server not working #829

Open fizu-3 opened 3 months ago

fizu-3 commented 3 months ago

Hello i created server on 1.16.5 but is not working, here is code:

    public ProxyController() {
        this.server = new TcpServer("0.0.0.0", 25565, MinecraftProtocol.class);
        this.server.setGlobalFlag(MinecraftConstants.SERVER_LOGIN_HANDLER_KEY,new PlayerJoinListener());
        this.server.setGlobalFlag(MinecraftConstants.SERVER_COMPRESSION_THRESHOLD, 100);
        this.server.setGlobalFlag(MinecraftConstants.VERIFY_USERS_KEY, false);

        server.setGlobalFlag(MinecraftConstants.SERVER_PING_TIME_HANDLER_KEY, (ServerPingTimeHandler) (session, pingTime) ->
                System.out.println("Server ping took " + pingTime + "ms"));
        server.bind();
    }

If I turn on the server and want to join it, it says "Disconnected" and 0 errors