aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/net/sowgro/npehero/levelapi/Difficulty.java
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2024-09-02 02:30:39 -0400
committersowgro <tpoke.ferrari@gmail.com>2024-09-02 02:30:39 -0400
commitd685d397573c43194fede9b2bbd3aee76d2cd9f8 (patch)
tree8f26bc510701955042be70ada44b81b5f3b15997 /src/main/java/net/sowgro/npehero/levelapi/Difficulty.java
parentef46303949173cd67cf00a4f40d16f1375ed2250 (diff)
downloadNPEhero-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-xsrc/main/java/net/sowgro/npehero/levelapi/Difficulty.java2
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