Skip to content

Commit

Permalink
fixed bug with saving on some operating systems, fixes #10
Browse files Browse the repository at this point in the history
  • Loading branch information
hafarooki committed Aug 14, 2019
1 parent 0bdc668 commit c81f607
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: "java"
apply plugin: "maven"

version = "2.3.0"
version = "2.3.1"

repositories {
mavenCentral()
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/net/starlegacy/explosionregen/WorldData.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ private List<ExplodedBlockData> load(World world) {
}

public void save(World world) {

File file = getFile(world);
file.getParentFile().mkdirs();

Expand Down Expand Up @@ -134,11 +133,15 @@ public void save(World world) {
output.write(tileData);
}
}
} catch (IOException e) {
e.printStackTrace();
tmpFile.delete();
}

try {
Files.move(tmpFile.toPath(), file.toPath(), StandardCopyOption.REPLACE_EXISTING);
} catch (IOException e) {
e.printStackTrace();
tmpFile.delete();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: ExplosionRegen
version: 2.3.0
version: 2.3.1
main: net.starlegacy.explosionregen.ExplosionRegenPlugin
authors: ["MicleBrick"]
api-version: 1.14
Expand Down

0 comments on commit c81f607

Please sign in to comment.