aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/net/sowgro/npehero/levelapi/Difficulty.java
diff options
context:
space:
mode:
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