From 592ca7b622d1b6d35fac47cf21c7f51ce0cd179d Mon Sep 17 00:00:00 2001 From: sowgro Date: Wed, 16 Oct 2024 23:49:40 -0400 Subject: Fix levels folder and autoscroll by default --- src/main/java/net/sowgro/npehero/levelapi/Levels.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main/java/net/sowgro/npehero/levelapi/Levels.java') diff --git a/src/main/java/net/sowgro/npehero/levelapi/Levels.java b/src/main/java/net/sowgro/npehero/levelapi/Levels.java index 7a89ed1..35ccfc8 100755 --- a/src/main/java/net/sowgro/npehero/levelapi/Levels.java +++ b/src/main/java/net/sowgro/npehero/levelapi/Levels.java @@ -43,6 +43,12 @@ public class Levels { } public static void readData(MessageUpdaterLambda mu, ProgressUpdaterLambda pu) throws IOException { list.clear(); + if (!dir.exists() && !dir.mkdir()) { + throw new IOException(); // TODO + } + if (!dir.isDirectory()) { + throw new IOException(); // TODO + } File[] fileList = dir.listFiles(); if (fileList == null) { throw new FileNotFoundException(); -- cgit v1.2.3