diff options
Diffstat (limited to 'src/main')
3 files changed, 16 insertions, 9 deletions
diff --git a/src/main/java/makamys/lodmod/mixin/MixinWorldRenderer.java b/src/main/java/makamys/lodmod/mixin/MixinWorldRenderer.java index 3dc2187..112c97c 100644 --- a/src/main/java/makamys/lodmod/mixin/MixinWorldRenderer.java +++ b/src/main/java/makamys/lodmod/mixin/MixinWorldRenderer.java @@ -91,7 +91,7 @@ abstract class MixinWorldRenderer implements IWorldRenderer { @Inject(method = "postRenderBlocks", at = @At(value = "HEAD")) private void prePostRenderBlocks(int pass, EntityLivingBase entity, CallbackInfo ci) { - if(LODMod.isActive()) { + if(LODMod.isActive() && !LODMod.renderer.disableChunkMeshes) { chunkMeshes.add(((ITessellator)Tessellator.instance).toChunkMesh(pass)); } } 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()); |