From 37a8f4376b20d360f953f67ce820758c64de33e2 Mon Sep 17 00:00:00 2001 From: makamys Date: Sat, 4 Jun 2022 15:54:19 +0200 Subject: Fix saving not getting disabled properly --- src/main/java/makamys/lodmod/renderer/LODRegion.java | 4 ++-- src/main/java/makamys/lodmod/renderer/LODRenderer.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/makamys/lodmod/renderer/LODRegion.java b/src/main/java/makamys/lodmod/renderer/LODRegion.java index ed13980..85de4c9 100644 --- a/src/main/java/makamys/lodmod/renderer/LODRegion.java +++ b/src/main/java/makamys/lodmod/renderer/LODRegion.java @@ -58,7 +58,7 @@ public class LODRegion { } public static LODRegion load(Path saveDir, int regionX, int regionZ) { - if(!LODMod.disableChunkMeshes && LODMod.saveMeshes) { + if(!(LODMod.disableChunkMeshes || !LODMod.saveMeshes)) { File saveFile = getSavePath(saveDir, regionX, regionZ).toFile(); if(saveFile.exists()) { try { @@ -77,7 +77,7 @@ public class LODRegion { } public void save(Path saveDir) { - if(LODMod.disableChunkMeshes && LODMod.saveMeshes) return; + if(LODMod.disableChunkMeshes || !LODMod.saveMeshes) return; try { File saveFile = getSavePath(saveDir, regionX, regionZ).toFile(); diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java index eb2996c..55ed1a7 100644 --- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java +++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java @@ -129,7 +129,7 @@ public class LODRenderer { runGC(); lastGCTime = System.currentTimeMillis(); } - if(lastSaveTime == -1 || (System.currentTimeMillis() - lastSaveTime) > saveInterval) { + if(lastSaveTime == -1 || (System.currentTimeMillis() - lastSaveTime) > saveInterval && LODMod.saveMeshes) { onSave(); lastSaveTime = System.currentTimeMillis(); } -- cgit