diff options
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle')
2 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/BoxPuzzleSolvingThread.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/BoxPuzzleSolvingThread.java index f4412419..8c63694b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/BoxPuzzleSolvingThread.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/BoxPuzzleSolvingThread.java @@ -23,6 +23,7 @@ public class BoxPuzzleSolvingThread extends Thread { this.playerX = playerX; this.playerY = playerY; this.callback = onDone; + System.out.println("new solving thread"); } Route solution = null; @@ -33,8 +34,8 @@ public class BoxPuzzleSolvingThread extends Thread { public void run() { solved = false; solution = solve(data,playerX,playerY, 20); - callback.run(); solved = true; + callback.run(); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java index 3b88de2d..e907671a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java @@ -25,7 +25,7 @@ import java.util.List; public class RoomProcessorBoxSolver extends GeneralRoomProcessor { - private BlockPos[][] poses = new BlockPos[6][7]; + private BlockPos[][] poses = new BlockPos[7][7]; private boolean bugged= true; private BoxPuzzleSolvingThread puzzleSolvingThread; @@ -92,7 +92,6 @@ public class RoomProcessorBoxSolver extends GeneralRoomProcessor { puzzleSolvingThread.start(); } if (calcReq) { - OffsetPointSet ops = (OffsetPointSet) getDungeonRoom().getDungeonRoomInfo().getProperties().get("board"); if (ops != null) { poses = new BlockPos[7][7]; @@ -105,6 +104,8 @@ public class RoomProcessorBoxSolver extends GeneralRoomProcessor { } calcDone = false; + if (puzzleSolvingThread != null) + puzzleSolvingThread.stop(); puzzleSolvingThread = new BoxPuzzleSolvingThread(currboard, 0, 6, new Runnable() { @Override public void run() { |