private void handleHandshake(Channel channel, ByteBuf byteBuf) {
        int length = ByteBufUtils.readVarInt(byteBuf);
        int opcode = ByteBufUtils.readVarInt(byteBuf);

        int protoVersion = ByteBufUtils.readVarInt(byteBuf);
        String address = ByteBufUtils.readUTF(byteBuf);
        int port = byteBuf.readUnsignedShort();
        int state = ByteBufUtils.readVarInt(byteBuf);

        // MaintenanceServer.LOGGER.info("ProtoVersion: " + protoVersion + ", Address: " + address + ", Port: " + port + ", State: " + state);

        Protocol[] protocols = Protocol.values();

        if (state < 0 || state >= protocols.length)
            disconnect(channel, "Requested state is out of bounds!");

        this.currentProtocol = protocols[state];

        if (this.currentProtocol == Protocol.STATUS) {
            sendStatusResponse(channel); // Immediately send the response
        } else if (this.currentProtocol == Protocol.LOGIN) {
            handleLogin(channel, byteBuf);
        }
    }