aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/lodmod/renderer/LODRegion.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/makamys/lodmod/renderer/LODRegion.java')
-rw-r--r--src/main/java/makamys/lodmod/renderer/LODRegion.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/main/java/makamys/lodmod/renderer/LODRegion.java b/src/main/java/makamys/lodmod/renderer/LODRegion.java
index 404ec81..0ed2324 100644
--- a/src/main/java/makamys/lodmod/renderer/LODRegion.java
+++ b/src/main/java/makamys/lodmod/renderer/LODRegion.java
@@ -58,14 +58,16 @@ public class LODRegion {
}
public static LODRegion load(Path saveDir, int regionX, int regionZ) {
- File saveFile = getSavePath(saveDir, regionX, regionZ).toFile();
- if(saveFile.exists()) {
- try {
- NBTTagCompound nbt = CompressedStreamTools.readCompressed(new FileInputStream(saveFile));
- return new LODRegion(regionX, regionZ, nbt);
- } catch (Exception e) {
- e.printStackTrace();
- }
+ if(!LODMod.renderer.disableChunkMeshes) {
+ File saveFile = getSavePath(saveDir, regionX, regionZ).toFile();
+ if(saveFile.exists()) {
+ try {
+ NBTTagCompound nbt = CompressedStreamTools.readCompressed(new FileInputStream(saveFile));
+ return new LODRegion(regionX, regionZ, nbt);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
}
return new LODRegion(regionX, regionZ);
}
@@ -75,6 +77,8 @@ public class LODRegion {
}
public void save(Path saveDir) {
+ if(LODMod.renderer.disableChunkMeshes) return;
+
try {
File saveFile = getSavePath(saveDir, regionX, regionZ).toFile();
saveFile.getParentFile().mkdirs();