Ошибка в коде простого лабиринта, часть значений для него считывается из текстового файла. Не могу разобраться, в чем дело

В файле лежат значения:

3 2

1 5

4 9

4 14

K T T T

Первая функция печатает лабиринт и позицию перса в нем. В части второй функции проходит проверка, находится ли перс в клетке с К. По идее, должен при этом активироваться ввод команды, но вообще ничего не происходит. Проверяла отладчиком, но легче не стало, часть кода с проверкой просто пропускает. Не понимаю, что сделала не так

static void printMaze(String[] maze, int pLine, int pColumn, String filename)
{
    try (FileInputStream in = new FileInputStream(filename)) {
        Scanner sc = new Scanner(in);

        int[] keyPos = new int[2];
        keyPos[0] = sc.nextInt();
        keyPos[1] = sc.nextInt();

        int[] treasPos1 = new int[2];
        treasPos1[0] = sc.nextInt();
        treasPos1[1] = sc.nextInt();

        int[] treasPos2 = new int[2];
        treasPos2[0] = sc.nextInt();
        treasPos2[1] = sc.nextInt();

        int[] treasPos3 = new int[2];
        treasPos3[0] = sc.nextInt();
        treasPos3[1] = sc.nextInt();

        String keyK = sc.next();
        String treaT1 = sc.next();
        String treaT2 = sc.next();
        String treaT3 = sc.next();

        for (int i = 0; i < maze.length; ++i) {
            if(i != pLine && i != keyPos[0] && i != treasPos1[0] && i != treasPos2[0] && i != treasPos3[0])
                System.out.println(maze[i]);
            else {
                for (int c = 0; c < maze[i].length(); ++c) {
                    if (maze[keyPos[0]].charAt(keyPos[1]) == '—' || maze[keyPos[0]].charAt(keyPos[1]) == '|') {
                        System.out.println("Ключь в стене! Проверьте координаты!");
                        System.exit(-1);
                    }

                    if (i == pLine && c == pColumn)
                        System.out.print('@');
                    else if (i == keyPos[0] && c == keyPos[1] && maze[i].charAt(c) != '—' && maze[i].charAt(c) != '|')
                        System.out.print(keyK);
                    else if (i == treasPos1[0] && c == treasPos1[1])
                        System.out.print(treaT1);
                    else if (i == treasPos2[0] && c == treasPos2[1])
                        System.out.print(treaT2);
                    else if (i == treasPos3[0] && c == treasPos3[1])
                        System.out.print(treaT3);
                    else {
                        System.out.print(maze[i].charAt(c));
                    }
                }
                System.out.println();
            }
        }
    } catch (IOException e) {
        System.out.println(e.getMessage());
    } catch (Exception e) {
        System.out.println("Что-то не так!");
    }
}

static void mazeMoves(String[] maze, int pLine, int pColumn, String filename, int keyCheck, int relic, int sumRelic)
{
    while (maze[pLine].charAt(pColumn) != 'E') {

        printMaze(maze, pLine, pColumn, filename);

        Scanner consoleSc = new Scanner(System.in);

        int nl = 0;
        int nc = 0;
        int personsHP = 10;

        if (maze[pLine].charAt(pColumn) == 'T') {
            sumRelic += relic;
            System.out.println("Сумма сокровищ: " + sumRelic);
        }

        if (maze[pLine].charAt(pColumn) == 'L') {
            personsHP -= 10;
            if (personsHP == 0) {
                System.out.println("Вы попали в ловушку! Начните заново!");
                System.exit(0);
            }
        }

        if (maze[pLine].charAt(pColumn) == 'K') {
            Scanner keySc = new Scanner(System.in);
            System.out.println("Введите 'Активировать', чтобы активировать сокровище!");
            String command1 = keySc.next();
            if (command1.equals("Активировать")) {
                keyCheck += 1;
            }
        }

Ответы (0 шт):