From 33d150b0908b1588c5d951baff270283acfa4a57 Mon Sep 17 00:00:00 2001 From: Leonardo Date: Sun, 17 Oct 2021 19:56:29 +0200 Subject: [PATCH] Disabled pre-gen loading for now + small fix --- .../builders/worldGeneration/LodNodeGenWorker.java | 5 +++-- src/main/java/com/seibel/lod/config/LodConfig.java | 11 +++++------ .../java/com/seibel/lod/handlers/ChunkLoader.java | 3 +++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/seibel/lod/builders/worldGeneration/LodNodeGenWorker.java b/src/main/java/com/seibel/lod/builders/worldGeneration/LodNodeGenWorker.java index aa987e9e6..beb8b648a 100644 --- a/src/main/java/com/seibel/lod/builders/worldGeneration/LodNodeGenWorker.java +++ b/src/main/java/com/seibel/lod/builders/worldGeneration/LodNodeGenWorker.java @@ -185,8 +185,9 @@ public class LodNodeGenWorker implements IWorker { IChunk loadedChunk = null; // long startTime = System.currentTimeMillis(); - if(LodConfig.CLIENT.worldGenerator.alwaysLoadPregeneratedChunks.get()) - loadedChunk = ChunkLoader.getChunkFromFile(pos); + //if(LodConfig.CLIENT.worldGenerator.alwaysLoadPregeneratedChunks.get()) + // loadedChunk = ChunkLoader.getChunkFromFile(pos); + //loadedChunk = ChunkLoader.getChunkFromFile(pos); if(loadedChunk == null) { switch (generationMode) diff --git a/src/main/java/com/seibel/lod/config/LodConfig.java b/src/main/java/com/seibel/lod/config/LodConfig.java index 1355e49cf..da7b04645 100644 --- a/src/main/java/com/seibel/lod/config/LodConfig.java +++ b/src/main/java/com/seibel/lod/config/LodConfig.java @@ -342,17 +342,16 @@ public class LodConfig + " Turning this on will make plains smoother since the tall grass won't be used. \n") .define("Avoid Blocks With No Collision", true); + /*alwaysLoadPregeneratedChunks = builder + .comment("\n\n" + + " if a chunk has been pre-generated, then the mod would use the real chunk for the \n" + + "fake chunk creation. May require a deletion of the lod file to see the result. \n") + .define("Use pre-generated chunks", true);*/ avoidNonFullBlocks = builder .comment("\n\n" + " If true LODs will only show full bocks when generating. \n" + " Turning this on will make plains smoother since the tall grass won't be used. \n") .define("Avoid Non Full Blocks", true); - - alwaysLoadPregeneratedChunks = builder - .comment("\n\n" - + " if a chunk has been pregenerated, then the mod would use the real chunk for the \n" - + " fake chunk creation. May require a deletion of the lod file to see the result. \n") - .define("Use pre-generated chunks", false); builder.pop(); } } diff --git a/src/main/java/com/seibel/lod/handlers/ChunkLoader.java b/src/main/java/com/seibel/lod/handlers/ChunkLoader.java index dd08d0945..388024eea 100644 --- a/src/main/java/com/seibel/lod/handlers/ChunkLoader.java +++ b/src/main/java/com/seibel/lod/handlers/ChunkLoader.java @@ -22,6 +22,9 @@ public class ChunkLoader ServerWorld serverWorld = LodUtil.getServerWorldFromDimension(clientWorld.dimensionType()); try { + File file = new File(serverWorld.getChunkSource().getDataStorage().dataFolder.getParent() + File.separatorChar + "region", "r." + (pos.x >> 5) + "." + (pos.z >> 5) + ".mca"); + if(!file.exists()) + return null; IChunk loadedChunk = ChunkSerializer.read( serverWorld, serverWorld.getStructureManager(),