aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/lodmod/renderer
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/makamys/lodmod/renderer')
-rw-r--r--src/main/java/makamys/lodmod/renderer/LODRegion.java20
-rw-r--r--src/main/java/makamys/lodmod/renderer/LODRenderer.java3
2 files changed, 15 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();
diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java
index 22a812e..3c8303d 100644
--- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java
+++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java
@@ -88,6 +88,7 @@ public class LODRenderer {
public int renderRange = 48;
private boolean freezeMeshes;
+ public boolean disableChunkMeshes = true;
public LODRenderer(){
hasInited = init();
@@ -447,6 +448,8 @@ public class LODRenderer {
}
public void onWorldRendererPost(WorldRenderer wr) {
+ if(disableChunkMeshes) return;
+
if(Minecraft.getMinecraft().theWorld.getChunkFromChunkCoords(Math.floorDiv(wr.posX, 16), Math.floorDiv(wr.posZ, 16)).isChunkLoaded) {
LODChunk lodChunk = getLODChunk(Math.floorDiv(wr.posX, 16), Math.floorDiv(wr.posZ, 16));
lodChunk.putChunkMeshes(Math.floorDiv(wr.posY, 16), ((IWorldRenderer)wr).getChunkMeshes());