From d685d397573c43194fede9b2bbd3aee76d2cd9f8 Mon Sep 17 00:00:00 2001 From: sowgro Date: Mon, 2 Sep 2024 02:30:39 -0400 Subject: Redesign editors --- src/main/java/net/sowgro/npehero/levelapi/Difficulty.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/net/sowgro/npehero/levelapi/Difficulty.java') diff --git a/src/main/java/net/sowgro/npehero/levelapi/Difficulty.java b/src/main/java/net/sowgro/npehero/levelapi/Difficulty.java index 99fa285..c21ecf1 100755 --- a/src/main/java/net/sowgro/npehero/levelapi/Difficulty.java +++ b/src/main/java/net/sowgro/npehero/levelapi/Difficulty.java @@ -82,7 +82,7 @@ public class Difficulty implements Comparable * @throws IOException If there is a problem writing to the file */ public void writeMetadata() throws IOException { - if (!jsonFile.createNewFile()) { + if (!jsonFile.exists() && !jsonFile.createNewFile()) { throw new IOException("Could not create file " + jsonFile.getAbsolutePath()); } Map data = jsonParser.fromJson(new FileReader(jsonFile), Map.class); // start with previous values -- cgit v1.2.3