aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2020-12-24 11:15:04 +0900
committersyeyoung <cyong06@naver.com>2020-12-24 11:15:04 +0900
commit4bf3172187396e9eedb852a887f98d7eb276f459 (patch)
treef5ff2ad06d8fe4e04aac3a4a176af55413d8652a /src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder
parent8a2635e8d7c7b47eb9236f89cd4cc0ab851f4da1 (diff)
downloadSkyblock-Dungeons-Guide-4bf3172187396e9eedb852a887f98d7eb276f459.tar.gz
Skyblock-Dungeons-Guide-4bf3172187396e9eedb852a887f98d7eb276f459.tar.bz2
Skyblock-Dungeons-Guide-4bf3172187396e9eedb852a887f98d7eb276f459.zip
toggles
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder')
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java16
1 files changed, 14 insertions, 2 deletions
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 2bf62add..4a4def5d 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java
@@ -50,10 +50,10 @@ public class DungeonRoomInfoRegistry {
}
public static void saveAll(File dir) {
- if (!e.DEBUG) return;
dir.mkdirs();
for (DungeonRoomInfo dungeonRoomInfo : registered) {
try {
+ if (!dungeonRoomInfo.isUserMade()) continue;
FileOutputStream fos = new FileOutputStream(new File(dir, dungeonRoomInfo.getUuid().toString() + ".roomdata"));
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(dungeonRoomInfo);
@@ -63,7 +63,7 @@ public class DungeonRoomInfoRegistry {
}
}
- public static void loadAll() throws BadPaddingException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, IOException, IllegalBlockSizeException, NoSuchPaddingException, InvalidKeyException {
+ public static void loadAll(File dir) throws BadPaddingException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, IOException, IllegalBlockSizeException, NoSuchPaddingException, InvalidKeyException {
registered.clear();
shapeMap.clear();
uuidMap.clear();
@@ -80,5 +80,17 @@ public class DungeonRoomInfoRegistry {
register(dri);
} catch (Exception e) {e.printStackTrace();}
}
+ for (File f : dir.listFiles()) {
+ if (!f.getName().endsWith(".roomdata")) continue;
+ try {
+ InputStream fis = new FileInputStream(f);
+ ObjectInputStream ois = new ObjectInputStream(fis);
+ DungeonRoomInfo dri = (DungeonRoomInfo) ois.readObject();
+ ois.close();
+ fis.close();
+ register(dri);
+ } catch (Exception e) {e.printStackTrace();}
+ }
}
+
}