diff options
author | syeyoung <cyoung06@naver.com> | 2023-02-25 20:16:38 +0900 |
---|---|---|
committer | syeyoung <cyoung06@naver.com> | 2023-02-25 20:16:38 +0900 |
commit | e133944b0760bd0eb2616b740f440aa8ae26b0ed (patch) | |
tree | bdc0f30760febc15b70e5bc3849c9d7e9ad23041 /mod/src | |
parent | 28ac4a24e29a3eec1b628c6529498be1ddb39a6b (diff) | |
download | Skyblock-Dungeons-Guide-e133944b0760bd0eb2616b740f440aa8ae26b0ed.tar.gz Skyblock-Dungeons-Guide-e133944b0760bd0eb2616b740f440aa8ae26b0ed.tar.bz2 Skyblock-Dungeons-Guide-e133944b0760bd0eb2616b740f440aa8ae26b0ed.zip |
- Fix 0 second blood rush crashing game
Signed-off-by: syeyoung <cyoung06@naver.com>
Diffstat (limited to 'mod/src')
-rwxr-xr-x | mod/src/main/java/kr/syeyoung/dungeonsguide/mod/SkyblockStatus.java | 6 | ||||
-rwxr-xr-x | mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/DungeonListener.java | 16 |
2 files changed, 14 insertions, 8 deletions
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/SkyblockStatus.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/SkyblockStatus.java index e74b69da..96445f7d 100755 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/SkyblockStatus.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/SkyblockStatus.java @@ -131,14 +131,14 @@ public class SkyblockStatus { return; } - Collection<Score> scores = objective.getScores(); boolean foundDungeon = false; + + Collection<Score> scores = objective.getScores(); for (Score sc : scores) { String strippedLine = TextUtils.keepScoreboardCharacters( TextUtils.stripColor(sc.getJustTeam())).trim(); if (strippedLine.contains("Cleared: ")) { foundDungeon = true; - DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); if(context != null){ context.setPercentage(Integer.parseInt( @@ -150,7 +150,7 @@ public class SkyblockStatus { } } - isOnDungeon = foundDungeon; + isOnDungeon = locationName.startsWith("The Catacombs") | foundDungeon; } } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/DungeonListener.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/DungeonListener.java index 99e6ae29..2fcdb159 100755 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/DungeonListener.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/events/listener/DungeonListener.java @@ -165,11 +165,17 @@ public class DungeonListener { context.getMapPlayerMarkerProcessor().tick(); context.tick(); } else { - if (SkyblockStatus.isOnDungeon()) { - DungeonsGuide.getDungeonsGuide().getDungeonFacade().setContext(new DungeonContext( - SkyblockStatus.locationName, - Minecraft.getMinecraft().thePlayer.worldObj)); - MinecraftForge.EVENT_BUS.post(new DungeonStartedEvent()); + try { + if (SkyblockStatus.isOnDungeon()) { + DungeonsGuide.getDungeonsGuide().getDungeonFacade().setContext(new DungeonContext( + SkyblockStatus.locationName, + Minecraft.getMinecraft().thePlayer.worldObj)); + MinecraftForge.EVENT_BUS.post(new DungeonStartedEvent()); + } + } catch (IllegalStateException e) { + if (! "?".equals(e.getMessage())) { + e.printStackTrace(); + } } } } |