From dd27fc9995164e8bb1c1f33ac849049f728fd28f Mon Sep 17 00:00:00 2001 From: syeyoung Date: Mon, 23 Jan 2023 00:19:27 +0900 Subject: - Fix #263 Signed-off-by: syeyoung --- .../syeyoung/dungeonsguide/mod/dungeon/roomfinder/DungeonRoom.java | 3 ++- .../mod/dungeon/roomprocessor/RoomProcessorTeleportMazeSolver.java | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'mod/src/main/java/kr/syeyoung') diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomfinder/DungeonRoom.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomfinder/DungeonRoom.java index 809f7272..236dcb40 100755 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomfinder/DungeonRoom.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomfinder/DungeonRoom.java @@ -98,7 +98,8 @@ public class DungeonRoom { } public void setCurrentState(RoomState currentState) { - context.getRecorder().createEvent(new DungeonStateChangeEvent(unitPoints.iterator().next(), dungeonRoomInfo.getName(), this.currentState, currentState)); + context.getRecorder().createEvent(new DungeonStateChangeEvent(unitPoints.iterator().next(), + dungeonRoomInfo == null ? null : dungeonRoomInfo.getName(), this.currentState, currentState)); this.currentState = currentState; } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorTeleportMazeSolver.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorTeleportMazeSolver.java index 927ed1de..b569380f 100755 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorTeleportMazeSolver.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/dungeon/roomprocessor/RoomProcessorTeleportMazeSolver.java @@ -87,7 +87,10 @@ public class RoomProcessorTeleportMazeSolver extends GeneralRoomProcessor { if (b == Blocks.stone_slab || b == Blocks.stone_slab2) { boolean teleport = false; - if (lastPlayerLocation != null && lastPlayerLocation.distanceSq(pos2) < 3) { + if (lastPlayerLocation == null) { + return; + } + if (lastPlayerLocation.distanceSq(pos2) < 3) { return; } for (BlockPos allInBox : BlockPos.getAllInBox(lastPlayerLocation, pos2)) { -- cgit