Added some more pre-gen testing code (disabled)

This commit is contained in:
Leonardo
2021-10-19 13:35:22 +02:00
parent 9d80b81378
commit 10382342d8
3 changed files with 42 additions and 11 deletions
@@ -185,19 +185,50 @@ 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))
{
//if(loadedChunk != null)
//
//{
// lodBuilder.generateLodNodeFromChunk(lodDim, loadedChunk, new LodBuilderConfig(DistanceGenerationMode.SERVER));
//}
//else
//{
/*
IChunk loadedChunk = null;
if (lodDim.isChunkPreGenerated(pos.x, pos.z) && LodConfig.CLIENT.worldGenerator.useExperimentalPreGenLoading.get())
{
generateWithServer();
// generate a Lod like normal
loadedChunk = ChunkLoader.getChunkFromFile(pos);
if(loadedChunk != null)
lodBuilder.generateLodNodeFromChunk(lodDim, loadedChunk, new LodBuilderConfig(DistanceGenerationMode.SERVER));
else
{
switch (generationMode)
{
case NONE:
// don't generate
break;
case BIOME_ONLY:
case BIOME_ONLY_SIMULATE_HEIGHT:
// fastest
generateUsingBiomesOnly();
break;
case SURFACE:
// faster
generateUsingSurface();
break;
case FEATURES:
// fast
generateUsingFeatures();
break;
case SERVER:
// very slow
lodBuilder.generateLodNodeFromChunk(lodDim, serverWorld.getChunk(pos.x, pos.z, ChunkStatus.FEATURES), new LodBuilderConfig(DistanceGenerationMode.SERVER));
//generateWithServer();
break;
}
}
}
else
{
{*/
switch (generationMode)
{
case NONE:
@@ -218,10 +249,10 @@ public class LodNodeGenWorker implements IWorker
break;
case SERVER:
// very slow
generateWithServer();
lodBuilder.generateLodNodeFromChunk(lodDim, serverWorld.getChunk(pos.x, pos.z, ChunkStatus.FEATURES), new LodBuilderConfig(DistanceGenerationMode.SERVER));
//generateWithServer();
break;
}
}
//}
//lodRenderer.regenerateLODsNextFrame();
@@ -212,7 +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 useExperimentalPreGenLoading;
//public final ForgeConfigSpec.BooleanValue useExperimentalPreGenLoading;
WorldGenerator(ForgeConfigSpec.Builder builder)
{
@@ -342,11 +342,11 @@ 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);
useExperimentalPreGenLoading = builder
/*useExperimentalPreGenLoading = 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", false);
.define("Use pre-generated chunks", false);*/
avoidNonFullBlocks = builder
.comment("\n\n"
+ " If true LODs will only show full bocks when generating. \n"
@@ -87,7 +87,7 @@ public class LodRegion
boolean fileFound = false;
preGeneratedChunkPos = new boolean[32 * 32];
/*
if (MinecraftWrapper.INSTANCE.hasSinglePlayerServer() && LodConfig.CLIENT.worldGenerator.useExperimentalPreGenLoading.get())
{
File regionFileDirHead;
@@ -137,7 +137,7 @@ public class LodRegion
e.printStackTrace();
}
System.out.println(string);
}
}*/
}