diff options
author | sowgro <tpoke.ferrari@gmail.com> | 2024-09-02 02:30:39 -0400 |
---|---|---|
committer | sowgro <tpoke.ferrari@gmail.com> | 2024-09-02 02:30:39 -0400 |
commit | d685d397573c43194fede9b2bbd3aee76d2cd9f8 (patch) | |
tree | 8f26bc510701955042be70ada44b81b5f3b15997 /src/main/java/net/sowgro/npehero/levelapi/Difficulty.java | |
parent | ef46303949173cd67cf00a4f40d16f1375ed2250 (diff) | |
download | NPEhero-d685d397573c43194fede9b2bbd3aee76d2cd9f8.tar.gz NPEhero-d685d397573c43194fede9b2bbd3aee76d2cd9f8.tar.bz2 NPEhero-d685d397573c43194fede9b2bbd3aee76d2cd9f8.zip |
Redesign editors
Diffstat (limited to 'src/main/java/net/sowgro/npehero/levelapi/Difficulty.java')
-rwxr-xr-x | src/main/java/net/sowgro/npehero/levelapi/Difficulty.java | 2 |
1 files changed, 1 insertions, 1 deletions
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<Difficulty> * @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<String, Object> data = jsonParser.fromJson(new FileReader(jsonFile), Map.class); // start with previous values |