diff options
author | syeyoung <cyong06@naver.com> | 2021-05-08 21:38:35 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-05-08 21:38:35 +0900 |
commit | 8dca95f49f14f7e2af945b12f569d83368823085 (patch) | |
tree | d4db33e841f31fc135305a914e30f25acd7939f4 /src/main/java | |
parent | 252f6533235dee8d5c6138009111c380acd3b50b (diff) | |
download | Skyblock-Dungeons-Guide-8dca95f49f14f7e2af945b12f569d83368823085.tar.gz Skyblock-Dungeons-Guide-8dca95f49f14f7e2af945b12f569d83368823085.tar.bz2 Skyblock-Dungeons-Guide-8dca95f49f14f7e2af945b12f569d83368823085.zip |
fix crashing when opensource
Diffstat (limited to 'src/main/java')
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/Main.java | 10 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java | 30 |
2 files changed, 21 insertions, 19 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/Main.java b/src/main/java/kr/syeyoung/dungeonsguide/Main.java index 85323acf..4983acba 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/Main.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/Main.java @@ -80,7 +80,7 @@ public class Main while (progressBar.getStep() < progressBar.getSteps()) progressBar.step("random-"+progressBar.getStep()); ProgressManager.pop(progressBar); - } catch (Exception e) { + } catch (Throwable e) { e.printStackTrace(); throwError(new String[]{ @@ -95,14 +95,12 @@ public class Main } throwError(new String[]{ - "Can't validate current installation of Dungeons Guide", + "Can't authenticate session", "Steps to fix", "1. check if other people can't join minecraft servers.", - "2. restart minecraft launcher", + "2. physically click on logout button, then login again", "3. make sure you're on the right account", - "4. restart your computer", - "If the problem persists after following these steps, please contact developer", - "If you haven't purchased the mod, please consider doing so" + "If the problem persists after following these steps, please contact developer" }); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java index 2bdc4206..479762cb 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java @@ -19,6 +19,7 @@ package kr.syeyoung.dungeonsguide.dungeon.roomfinder; import com.google.common.io.Files; +import kr.syeyoung.dungeonsguide.Main; import kr.syeyoung.dungeonsguide.dungeon.data.DungeonRoomInfo; import net.minecraft.client.Minecraft; import org.apache.commons.io.IOUtils; @@ -106,19 +107,22 @@ public class DungeonRoomInfoRegistry { registered.clear(); shapeMap.clear(); uuidMap.clear(); - URL url = new URL("z:///roomdata/datas.txt"); - List<String> lines = IOUtils.readLines(url.openConnection().getInputStream()); - for (String name : lines) { - if (!name.endsWith(".roomdata")) continue; - try { - InputStream fis = new URL("z:///"+name).openStream(); - ObjectInputStream ois = new ObjectInputStream(fis); - DungeonRoomInfo dri = (DungeonRoomInfo) ois.readObject(); - ois.close(); - fis.close(); - register(dri); - } catch (Exception e) {e.printStackTrace();} - } + try { + List<String> lines = IOUtils.readLines(Main.class.getResourceAsStream("/roomdata/datas.txt")); + for (String name : lines) { + if (!name.endsWith(".roomdata")) continue; + try { + InputStream fis = Main.class.getResourceAsStream("/"+name); + ObjectInputStream ois = new ObjectInputStream(fis); + DungeonRoomInfo dri = (DungeonRoomInfo) ois.readObject(); + ois.close(); + fis.close(); + register(dri); + } catch (Exception e) { + e.printStackTrace(); + } + } + } catch (Exception e) {e.printStackTrace();} for (File f : dir.listFiles()) { if (!f.getName().endsWith(".roomdata")) continue; try { |