aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/lodmod/renderer/LODRenderer.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/makamys/lodmod/renderer/LODRenderer.java')
-rw-r--r--src/main/java/makamys/lodmod/renderer/LODRenderer.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java
index 4c5c50f..ca661a7 100644
--- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java
+++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java
@@ -7,11 +7,13 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.Entity;
import net.minecraft.world.ChunkCoordIntPair;
+import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.gen.ChunkProviderServer;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
+import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -576,6 +578,13 @@ public class LODRenderer {
);
}
+ public void onSave(World world) {
+ String worldName = world.getWorldInfo().getWorldName();
+ Path saveDir = Minecraft.getMinecraft().mcDataDir.toPath().resolve("lodmod").resolve(worldName);
+
+ loadedRegionsMap.forEach((k, v) -> v.save(saveDir));
+ }
+
public static class LODChunkComparator implements Comparator<LODChunk> {
Entity player;