aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/lodmod
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/makamys/lodmod')
-rw-r--r--src/main/java/makamys/lodmod/renderer/LODRegion.java17
-rw-r--r--src/main/java/makamys/lodmod/renderer/LODRenderer.java3
2 files changed, 18 insertions, 2 deletions
diff --git a/src/main/java/makamys/lodmod/renderer/LODRegion.java b/src/main/java/makamys/lodmod/renderer/LODRegion.java
index 2fa4f01..404ec81 100644
--- a/src/main/java/makamys/lodmod/renderer/LODRegion.java
+++ b/src/main/java/makamys/lodmod/renderer/LODRegion.java
@@ -102,7 +102,22 @@ public class LODRegion {
}
}
nbt.setTag("chunks", list);
- CompressedStreamTools.writeCompressed(nbt, new FileOutputStream(saveFile));
+
+ new Thread(
+ new Runnable() {
+
+ @Override
+ public void run() {
+ try {
+ CompressedStreamTools.writeCompressed(nbt, new FileOutputStream(saveFile));
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }).start();
+
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java
index 7578633..22a812e 100644
--- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java
+++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java
@@ -627,8 +627,9 @@ public class LODRenderer {
public void onSave() {
System.out.println("Saving LOD regions...");
+ long t0 = System.currentTimeMillis();
loadedRegionsMap.forEach((k, v) -> v.save(getSaveDir()));
- System.out.println("Finished saving LOD regions");
+ System.out.println("Finished saving LOD regions in " + ((System.currentTimeMillis() - t0) / 1000.0) + "s");
}
private Path getSaveDir(){