Skip to content

Commit 10bd49a

Browse files
authored
Merge pull request #10 from iLexiconn/patch-1
Fix #5
2 parents b0386f9 + 065d794 commit 10bd49a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/java/mmd/orespawn/json/OreSpawnWriter.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ public void writeSpawnEntries() {
2424
Gson gson = new GsonBuilder().setPrettyPrinting().create();
2525

2626
for (Map.Entry<String, SpawnLogic> entry : OreSpawn.API.getAllSpawnLogic().entrySet()) {
27+
File file = new File("." + File.separator + "orespawn", entry.getKey() + ".json");
28+
29+
if (file.exists()) {
30+
continue;
31+
}
32+
2733
Map<Integer, DimensionLogic> dimensions = entry.getValue().getAllDimensions();
2834

2935
JsonArray array = new JsonArray();
@@ -76,7 +82,7 @@ public void writeSpawnEntries() {
7682
String json = gson.toJson(array);
7783

7884
try {
79-
FileUtils.writeStringToFile(new File("." + File.separator + "orespawn", entry.getKey() + ".json"), StringEscapeUtils.unescapeJson(json), Charsets.UTF_8);
85+
FileUtils.writeStringToFile(file, StringEscapeUtils.unescapeJson(json), Charsets.UTF_8);
8086
} catch (IOException e) {
8187
e.printStackTrace();
8288
}

0 commit comments

Comments
 (0)