From 2113a4c7ffe9ff395c3460371beafb2ada24ec5e Mon Sep 17 00:00:00 2001 From: syeyoung Date: Mon, 27 Feb 2023 02:14:32 +0900 Subject: - Check if RoomMatcher is instantiated (because it might not be) Signed-off-by: syeyoung --- .../mod/features/impl/advanced/FeatureRoomCoordDisplay.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mod/src/main/java/kr/syeyoung') diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomCoordDisplay.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomCoordDisplay.java index 9c66a960..1b9237af 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomCoordDisplay.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/impl/advanced/FeatureRoomCoordDisplay.java @@ -53,7 +53,7 @@ public class FeatureRoomCoordDisplay extends TextHUDFeature { return new TextSpan(getStyle("coord"), "X: 0 Y: 3 Z: 5 Facing: Z+"); } - private static final String[] facing = {"Z+", "X-", "Z-", "X+"}; + private static final String[] facing = {"Z+", "X-", "Z-", "X+", "??"}; @Override public boolean isHUDViewable() { @@ -86,7 +86,8 @@ public class FeatureRoomCoordDisplay extends TextHUDFeature { int facing = (int) (thePlayer.rotationYaw + 45) % 360; if (facing < 0) facing += 360; - int real = (facing / 90 + dungeonRoom.getRoomMatcher().getRotation()) % 4; + int real = dungeonRoom.getRoomMatcher() != null ? + (facing / 90 + dungeonRoom.getRoomMatcher().getRotation()) % 4 : 4; OffsetPoint offsetPoint = new OffsetPoint(dungeonRoom, new BlockPos((int)thePlayer.posX, (int)thePlayer.posY, (int)thePlayer.posZ)); -- cgit