Added config for pre-generated chunk loading

This commit is contained in:
Leonardo
2021-10-17 19:21:56 +02:00
parent d3cd714f48
commit b411f083e2
2 changed files with 10 additions and 1 deletions
@@ -183,8 +183,10 @@ public class LodNodeGenWorker implements IWorker
/* TODO I must disable this 'if', if I will find a way to replace it */
if (lodDim.regionIsInRange(pos.x / LodUtil.REGION_WIDTH_IN_CHUNKS, pos.z / LodUtil.REGION_WIDTH_IN_CHUNKS))
{
IChunk loadedChunk = null;
// long startTime = System.currentTimeMillis();
IChunk loadedChunk = ChunkLoader.getChunkFromFile(pos);
if(LodConfig.CLIENT.worldGenerator.alwaysLoadPregeneratedChunks.get())
loadedChunk = ChunkLoader.getChunkFromFile(pos);
if(loadedChunk == null)
{
switch (generationMode)
@@ -212,6 +212,7 @@ public class LodConfig
public final ForgeConfigSpec.EnumValue<HorizontalQuality> horizontalQuality;
public final ForgeConfigSpec.BooleanValue avoidBlocksWithNoCollision;
public final ForgeConfigSpec.BooleanValue avoidNonFullBlocks;
public final ForgeConfigSpec.BooleanValue alwaysLoadPregeneratedChunks;
WorldGenerator(ForgeConfigSpec.Builder builder)
{
@@ -346,6 +347,12 @@ public class LodConfig
+ " 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();
}
}