From 6741084ce1cee8648edb4af418a879321a7de4c0 Mon Sep 17 00:00:00 2001 From: makamys Date: Mon, 10 May 2021 22:02:01 +0200 Subject: Change save interval to 60 seconds --- src/main/java/makamys/lodmod/renderer/LODRenderer.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/main/java/makamys/lodmod/renderer/LODRenderer.java') diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java index 4b2e016..7578633 100644 --- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java +++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java @@ -81,7 +81,9 @@ public class LODRenderer { private double lastSortZ = Double.NaN; private long lastGCTime = -1; - private long gcInterval = 60 * 1000; + private long lastSaveTime = -1; + private long gcInterval = 10 * 1000; + private long saveInterval = 60 * 1000; public int renderRange = 48; @@ -105,12 +107,14 @@ public class LODRenderer { mainLoop(); handleKeyboard(); - gcInterval = 10 * 1000; if(lastGCTime == -1 || (System.currentTimeMillis() - lastGCTime) > gcInterval) { runGC(); - onSave(); lastGCTime = System.currentTimeMillis(); } + if(lastSaveTime == -1 || (System.currentTimeMillis() - lastSaveTime) > saveInterval) { + onSave(); + lastSaveTime = System.currentTimeMillis(); + } if(renderLOD) { sort(); -- cgit