WorldGen Config Overhaul + General cleanup

This commit is contained in:
tom lee
2022-01-25 16:26:34 +08:00
parent bdd877abe8
commit 7fa99ea070
12 changed files with 175 additions and 137 deletions
@@ -42,7 +42,8 @@ public class CubicLodTemplate
{
public static void addLodToBuffer(LodBufferBuilder buffer, int playerX, int playerZ, long data, Map<LodDirection, long[]> adjData,
byte detailLevel, int posX, int posZ, VertexOptimizer vertexOptimizer, DebugMode debugging, boolean[] adjShadeDisabled, int cullingRangeX, int cullingRangeZ)
byte detailLevel, int posX, int posZ, VertexOptimizer vertexOptimizer, DebugMode debugging, boolean[] adjShadeDisabled
)//, int cullingRangeX, int cullingRangeZ)
{
if (vertexOptimizer == null)
return;
@@ -76,7 +77,7 @@ public class CubicLodTemplate
DataPointUtil.getLightBlock(data),
adjShadeDisabled);
addBoundingBoxToBuffer(buffer, vertexOptimizer, cullingRangeX, cullingRangeZ);
addBoundingBoxToBuffer(buffer, vertexOptimizer);//, cullingRangeX, cullingRangeZ);
}
/** add the given position and color to the buffer */
@@ -123,7 +124,7 @@ public class CubicLodTemplate
vertexOptimizer.setAdjData(adjData);
}
private static void addBoundingBoxToBuffer(LodBufferBuilder buffer, VertexOptimizer vertexOptimizer, int cullingRangeX, int cullingRangeZ)
private static void addBoundingBoxToBuffer(LodBufferBuilder buffer, VertexOptimizer vertexOptimizer)//, int cullingRangeX, int cullingRangeZ)
{
int color;
byte skyLight;
@@ -73,7 +73,7 @@ public class LodBufferBuilderFactory
//TODO: Do some Perf logging of Buffer Building
public static final boolean ENABLE_BUFFER_PERF_LOGGING = false;
public static final boolean ENABLE_BUFFER_SWAP_LOGGING = false;
public static final boolean ENABLE_BUFFER_SWAP_LOGGING = true;
public static final boolean ENABLE_BUFFER_UPLOAD_LOGGING = false;
public static final boolean ENABLE_LAG_SPIKE_LOGGING = false;
public static final long LAG_SPIKE_THRESOLD_NS = TimeUnit.NANOSECONDS.convert(16, TimeUnit.MILLISECONDS);
@@ -296,9 +296,9 @@ public class LodBufferBuilderFactory
//================================//
skyLightPlayer = MC.getWrappedClientWorld().getSkyLight(playerX, playerY, playerZ);
int minCullingRange = SingletonHandler.get(ILodConfigWrapperSingleton.class).client().graphics().advancedGraphics().getBacksideCullingRange();
int cullingRangeX = Math.max((int)(1.5 * Math.abs(lastX - playerX)), minCullingRange);
int cullingRangeZ = Math.max((int)(1.5 * Math.abs(lastZ - playerZ)), minCullingRange);
//int minCullingRange = SingletonHandler.get(ILodConfigWrapperSingleton.class).client().graphics().advancedGraphics().getBacksideCullingRange();
//int cullingRangeX = Math.max((int)(1.5 * Math.abs(lastX - playerX)), minCullingRange);
//int cullingRangeZ = Math.max((int)(1.5 * Math.abs(lastZ - playerZ)), minCullingRange);
lastX = playerX;
lastZ = playerZ;
@@ -330,7 +330,7 @@ public class LodBufferBuilderFactory
final int pZ = playerZ;
nodeToRenderThreads.add(() -> {
return makeLodRenderData(lodDim, regionPos, pX, pZ, vboX, vboZ, minDetail, cullingRangeX, cullingRangeZ);
return makeLodRenderData(lodDim, regionPos, pX, pZ, vboX, vboZ, minDetail);//, cullingRangeX, cullingRangeZ);
});
} // region z
} // region z
@@ -425,7 +425,7 @@ public class LodBufferBuilderFactory
private static final ThreadLocal<Map<LodDirection, long[]>> tLocalAdjData = new ThreadLocal<Map<LodDirection, long[]>>();
private boolean makeLodRenderData(LodDimension lodDim, RegionPos regPos, int playerX, int playerZ,
int vboX, int vboZ, byte minDetail, int cullingRangeX, int cullingRangeZ) {
int vboX, int vboZ, byte minDetail) {//, int cullingRangeX, int cullingRangeZ) {
//Variable initialization
int playerChunkX = LevelPosUtil.convert(LodUtil.BLOCK_DETAIL_LEVEL,playerX,LodUtil.CHUNK_DETAIL_LEVEL);
@@ -554,7 +554,7 @@ public class LodBufferBuilderFactory
//We send the call to create the vertices
CubicLodTemplate.addLodToBuffer(currentBuffer, vboX, vboZ, data, adjData,
detailLevel, posX, posZ, vertexOptimizer, debugMode, adjShadeDisabled, cullingRangeX, cullingRangeZ);
detailLevel, posX, posZ, vertexOptimizer, debugMode, adjShadeDisabled);//, cullingRangeX, cullingRangeZ);
}
} // for pos to in list to render
@@ -19,6 +19,7 @@
package com.seibel.lod.core.builders.lodBuilding;
import java.util.Arrays;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@@ -178,18 +179,27 @@ public class LodBuilder
// generate the LODs
int maxVerticalData = DetailDistanceUtil.getMaxVerticalData((byte)0);
long[] data = new long[maxVerticalData*16*16];
for (int i = 0; i < 16*16; i++)
{
int subX = i/16;
int subZ = i%16;
writeVerticalData(data, i*maxVerticalData, maxVerticalData, chunk, config, subX, subZ);
//if (DataPointUtil.isVoid(data[i*maxVerticalData]))
// ClientApi.LOGGER.debug("Datapoint is Void: {}, {}", chunk.getMinX()+subX, chunk.getMinZ()+subZ);
if (!DataPointUtil.doesItExist(data[i*maxVerticalData]))
throw new RuntimeException("Datapoint does not exist at "+ chunk.getMinX()+subX +", "+ chunk.getMinZ()+subZ);
if (DataPointUtil.getGenerationMode(data[i*maxVerticalData]) != config.distanceGenerationMode.complexity)
throw new RuntimeException("Datapoint invalid at "+ chunk.getMinX()+subX +", "+ chunk.getMinZ()+subZ);
if (!config.quickFillWithVoid) {
for (int i = 0; i < 16*16; i++)
{
int subX = i/16;
int subZ = i%16;
writeVerticalData(data, i*maxVerticalData, maxVerticalData, chunk, config, subX, subZ);
//if (DataPointUtil.isVoid(data[i*maxVerticalData]))
// ClientApi.LOGGER.debug("Datapoint is Void: {}, {}", chunk.getMinX()+subX, chunk.getMinZ()+subZ);
if (!DataPointUtil.doesItExist(data[i*maxVerticalData]))
throw new RuntimeException("Datapoint does not exist at "+ chunk.getMinX()+subX +", "+ chunk.getMinZ()+subZ);
if (DataPointUtil.getGenerationMode(data[i*maxVerticalData]) != config.distanceGenerationMode.complexity)
throw new RuntimeException("Datapoint invalid at "+ chunk.getMinX()+subX +", "+ chunk.getMinZ()+subZ);
}
} else {
for (int i = 0; i < 16*16; i++)
{
data[i*maxVerticalData] = DataPointUtil.createVoidDataPoint(config.distanceGenerationMode.complexity);
}
}
if (!chunk.isLightCorrect()) return false;
region.isWriting++;
@@ -207,6 +217,8 @@ public class LodBuilder
if (!region.doesDataExist((byte)0, chunk.getMinX(), chunk.getMinZ(), config.distanceGenerationMode))
throw new RuntimeException("data at detail 0 is still null after writes to it!");
if (!region.doesDataExist(LodUtil.CHUNK_DETAIL_LEVEL, chunk.getChunkPosX(), chunk.getChunkPosZ(), config.distanceGenerationMode))
throw new RuntimeException("data at chunk detail level is still null after writes to it!");
} catch (Exception e) {
e.printStackTrace();
} finally {
@@ -39,6 +39,7 @@ public class LodBuilderConfig
public boolean useSolidBlocksInColorGen;
/** default: server */
public DistanceGenerationMode distanceGenerationMode;
public boolean quickFillWithVoid;
/**
* default settings for a normal chunk <br>
@@ -47,49 +48,18 @@ public class LodBuilderConfig
* useSolidBlocksInColorGen = true <br>
* generationMode = Server <br>
*/
public LodBuilderConfig()
public LodBuilderConfig(DistanceGenerationMode newDistanceGenerationMode)
{
useHeightmap = false;
useBiomeColors = false;
useSolidBlocksInColorGen = true;
distanceGenerationMode = DistanceGenerationMode.FULL;
}
/**
* @param newUseHeightmap default = false
* @param newUseBiomeColors default = false
* @param newUseSolidBlocksInBiomeColor default = true
* @param newDistanceGenerationMode default = Server
*/
public LodBuilderConfig(boolean newUseHeightmap, boolean newUseBiomeColors,
boolean newUseSolidBlocksInBiomeColor, DistanceGenerationMode newDistanceGenerationMode)
{
useHeightmap = newUseHeightmap;
useBiomeColors = newUseBiomeColors;
useSolidBlocksInColorGen = newUseSolidBlocksInBiomeColor;
quickFillWithVoid = false;
distanceGenerationMode = newDistanceGenerationMode;
}
/**
* @param newUseHeightmap default = false
* @param newUseBiomeColors default = false
* @param newUseSolidBlocksInBiomeColor default = true
*/
public LodBuilderConfig(boolean newUseHeightmap, boolean newUseBiomeColors, boolean newUseSolidBlocksInBiomeColor)
{
this();
useHeightmap = newUseHeightmap;
useBiomeColors = newUseBiomeColors;
useSolidBlocksInColorGen = newUseSolidBlocksInBiomeColor;
distanceGenerationMode = newUseHeightmap ? DistanceGenerationMode.BIOME_ONLY_SIMULATE_HEIGHT : DistanceGenerationMode.BIOME_ONLY;
}
/**
* @param newDistanceGenerationMode default = Server
*/
public LodBuilderConfig(DistanceGenerationMode newDistanceGenerationMode)
{
this();
distanceGenerationMode = newDistanceGenerationMode;
public static LodBuilderConfig getFillVoidConfig() {
LodBuilderConfig config = new LodBuilderConfig(DistanceGenerationMode.NONE);
config.quickFillWithVoid = true;
return config;
}
}
@@ -94,28 +94,17 @@ public class LodWorldGenerator
*/
public void queueGenerationRequests(LodDimension lodDim, LodBuilder lodBuilder)
{
if (!CONFIG.client().worldGenerator().getEnableDistantGeneration()) return;
IWorldWrapper world = LodUtil.getServerWorldFromDimension(lodDim.dimension);
// TODO: Rename the config option
if (CONFIG.client().worldGenerator().getAllowUnstableFeatureGeneration()) {
if (experimentalWorldGenerator == null) {
try {
experimentalWorldGenerator = WRAPPER_FACTORY.createExperimentalWorldGenerator(lodBuilder, lodDim, world);
if (experimentalWorldGenerator == null) CONFIG.client().worldGenerator().setAllowUnstableFeatureGeneration(false);
} catch (RuntimeException e) {
// Exception may happen if world got unloaded unorderly
e.printStackTrace();
}
}
} else {
if (experimentalWorldGenerator != null) {
try {
experimentalWorldGenerator.stop();
} catch (RuntimeException e) {
e.printStackTrace();
}
experimentalWorldGenerator = null;
if (experimentalWorldGenerator == null) {
try {
experimentalWorldGenerator = WRAPPER_FACTORY.createExperimentalWorldGenerator(lodBuilder, lodDim, world);
} catch (RuntimeException e) {
// Exception may happen if world got unloaded unorderly
e.printStackTrace();
}
}
@@ -36,7 +36,7 @@ package com.seibel.lod.core.enums.config;
public enum DistanceGenerationMode
{
/**
* Don't generate anything
* Don't generate anything except just load in already existing chunks
*/
NONE((byte) 0),
@@ -82,6 +82,7 @@ public enum DistanceGenerationMode
*/
FULL((byte) 5);
public static DistanceGenerationMode RENDERABLE = DistanceGenerationMode.BIOME_ONLY;
/**
* The higher the number the more complete the generation is.
@@ -32,10 +32,12 @@ package com.seibel.lod.core.enums.config;
*/
public enum GenerationPriority
{
/** NEAR_FIRST when connected to servers and FAR_FIRST when on single player */
/** NEAR_FIRST when connected to servers and BALANCED when on single player */
AUTO,
NEAR_FIRST,
BALANCED,
FAR_FIRST
}
@@ -0,0 +1,11 @@
package com.seibel.lod.core.enums.config;
public enum LightGenerationMode
{
// Fake in light values based on height maps
FAST,
// Run the light engine though the chunk to generate proper light values
FANCY
}
@@ -29,6 +29,16 @@ public class LodDimensionOldFileStructureHandler
private final File dimensionDataSaveFolder;
private final LodDimensionFileHandler newFileHandler;
enum OldDistanceGenerationMode {
NONE,
BIOME_ONLY,
BIOME_ONLY_SIMULATE_HEIGHT,
SURFACE,
FEATURES,
FULL
}
/** lod */
private static final String FILE_NAME_PREFIX = "lod";
@@ -64,7 +74,7 @@ public class LodDimensionOldFileStructureHandler
}
private void loadGenModeToRegion(TempLodRegion region, DistanceGenerationMode genMode)
private void loadGenModeToRegion(TempLodRegion region, OldDistanceGenerationMode genMode)
{
int regionX = region.posX;
int regionZ = region.posZ;
@@ -142,12 +152,12 @@ public class LodDimensionOldFileStructureHandler
ClientApi.LOGGER.info("Merging region "+regionPos+" at "+verticalQuality+"...");
TempLodRegion region = new TempLodRegion(verticalQuality, regionPos);
ClientApi.LOGGER.info("Reading data...");
loadGenModeToRegion(region, DistanceGenerationMode.FULL);
loadGenModeToRegion(region, DistanceGenerationMode.FEATURES);
loadGenModeToRegion(region, DistanceGenerationMode.SURFACE);
loadGenModeToRegion(region, DistanceGenerationMode.BIOME_ONLY_SIMULATE_HEIGHT);
loadGenModeToRegion(region, DistanceGenerationMode.BIOME_ONLY);
loadGenModeToRegion(region, DistanceGenerationMode.NONE);
loadGenModeToRegion(region, OldDistanceGenerationMode.FULL);
loadGenModeToRegion(region, OldDistanceGenerationMode.FEATURES);
loadGenModeToRegion(region, OldDistanceGenerationMode.SURFACE);
loadGenModeToRegion(region, OldDistanceGenerationMode.BIOME_ONLY_SIMULATE_HEIGHT);
loadGenModeToRegion(region, OldDistanceGenerationMode.BIOME_ONLY);
loadGenModeToRegion(region, OldDistanceGenerationMode.NONE);
ClientApi.LOGGER.info("Writing data...");
saveRegion(region);
ClientApi.LOGGER.info("region "+regionPos+" at "+verticalQuality+" merged");
@@ -167,7 +177,7 @@ public class LodDimensionOldFileStructureHandler
}
}
private HashSet<RegionPos> scanOldRegionFiles(VerticalQuality vertQual, DistanceGenerationMode genMode) {
private HashSet<RegionPos> scanOldRegionFiles(VerticalQuality vertQual, OldDistanceGenerationMode genMode) {
HashSet<RegionPos> result = new HashSet<RegionPos>();
File baseBaseFolder = new File(getFileBasePath() + vertQual + File.separatorChar + genMode);
if (!baseBaseFolder.exists()) return result;
@@ -187,7 +197,7 @@ public class LodDimensionOldFileStructureHandler
return result;
}
private void renameOldFileStructure(VerticalQuality vertQual, DistanceGenerationMode genMode) {
private void renameOldFileStructure(VerticalQuality vertQual, OldDistanceGenerationMode genMode) {
File baseBaseFolder = new File(getFileBasePath() + vertQual + File.separatorChar + genMode);
if (!baseBaseFolder.exists()) return;
baseBaseFolder.renameTo(new File(getFileBasePath() + vertQual + File.separatorChar + genMode + RETIRED_OLD_STRUCT_POSTFIX));
@@ -198,12 +208,12 @@ public class LodDimensionOldFileStructureHandler
if (!baseFile.exists()) return;
if (!baseFile.isDirectory()) return;
HashSet<RegionPos> totalPos = new HashSet<RegionPos>();
totalPos.addAll(scanOldRegionFiles(vertQual, DistanceGenerationMode.NONE));
totalPos.addAll(scanOldRegionFiles(vertQual, DistanceGenerationMode.BIOME_ONLY));
totalPos.addAll(scanOldRegionFiles(vertQual, DistanceGenerationMode.BIOME_ONLY_SIMULATE_HEIGHT));
totalPos.addAll(scanOldRegionFiles(vertQual, DistanceGenerationMode.SURFACE));
totalPos.addAll(scanOldRegionFiles(vertQual, DistanceGenerationMode.FEATURES));
totalPos.addAll(scanOldRegionFiles(vertQual, DistanceGenerationMode.FULL));
totalPos.addAll(scanOldRegionFiles(vertQual, OldDistanceGenerationMode.NONE));
totalPos.addAll(scanOldRegionFiles(vertQual, OldDistanceGenerationMode.BIOME_ONLY));
totalPos.addAll(scanOldRegionFiles(vertQual, OldDistanceGenerationMode.BIOME_ONLY_SIMULATE_HEIGHT));
totalPos.addAll(scanOldRegionFiles(vertQual, OldDistanceGenerationMode.SURFACE));
totalPos.addAll(scanOldRegionFiles(vertQual, OldDistanceGenerationMode.FEATURES));
totalPos.addAll(scanOldRegionFiles(vertQual, OldDistanceGenerationMode.FULL));
ArrayList<Future<?>> futures = new ArrayList<Future<?>>();
for (RegionPos pos : totalPos) {
futures.add(mergerThreads.submit(() -> {
@@ -223,12 +233,12 @@ public class LodDimensionOldFileStructureHandler
}
});
renameOldFileStructure(vertQual, DistanceGenerationMode.NONE);
renameOldFileStructure(vertQual, DistanceGenerationMode.BIOME_ONLY);
renameOldFileStructure(vertQual, DistanceGenerationMode.BIOME_ONLY_SIMULATE_HEIGHT);
renameOldFileStructure(vertQual, DistanceGenerationMode.SURFACE);
renameOldFileStructure(vertQual, DistanceGenerationMode.FEATURES);
renameOldFileStructure(vertQual, DistanceGenerationMode.FULL);
renameOldFileStructure(vertQual, OldDistanceGenerationMode.NONE);
renameOldFileStructure(vertQual, OldDistanceGenerationMode.BIOME_ONLY);
renameOldFileStructure(vertQual, OldDistanceGenerationMode.BIOME_ONLY_SIMULATE_HEIGHT);
renameOldFileStructure(vertQual, OldDistanceGenerationMode.SURFACE);
renameOldFileStructure(vertQual, OldDistanceGenerationMode.FEATURES);
renameOldFileStructure(vertQual, OldDistanceGenerationMode.FULL);
}
private String getFileBasePath() {
@@ -234,7 +234,7 @@ public class LodRegion {
byte childDetailLevel = (byte) (detailLevel - 1);
int childOffsetPosX = offsetPosX * 2;
int childOffsetPosZ = offsetPosZ * 2;
DistanceGenerationMode testerGenMode = detailLevel > LodUtil.CHUNK_DETAIL_LEVEL ? DistanceGenerationMode.NONE : genMode;
DistanceGenerationMode testerGenMode = genMode;//detailLevel >= LodUtil.CHUNK_DETAIL_LEVEL ? DistanceGenerationMode.NONE : genMode;
byte targetDetailLevel = DetailDistanceUtil.getDetailLevelFromDistance(minDistance);
int farModeSwitchLevel = (priority == GenerationPriority.NEAR_FIRST) ? -1 : calculateFarModeSwitch(targetDetailLevel);
@@ -378,7 +378,7 @@ public class LodRegion {
int childrenCount = 0;
for (int x = 0; x <= 1; x++) {
for (int z = 0; z <= 1; z++) {
if (doesDataExist(childDetailLevel, childPosX + x, childPosZ + z, DistanceGenerationMode.NONE)) {
if (doesDataExist(childDetailLevel, childPosX + x, childPosZ + z, DistanceGenerationMode.RENDERABLE)) {
childrenCount++;
}
}
@@ -499,7 +499,7 @@ public class LodRegion {
// TODO what does that mean? bottom of what?
return DataPointUtil.getGenerationMode(dataContainer[detailLevel].getSingleData(modPosX, modPosZ));
else
return DistanceGenerationMode.NONE.complexity;
throw new RuntimeException("Data does not exist!");
}
/**
@@ -27,6 +27,7 @@ import com.seibel.lod.core.enums.config.GenerationPriority;
import com.seibel.lod.core.enums.config.GpuUploadMethod;
import com.seibel.lod.core.enums.config.HorizontalQuality;
import com.seibel.lod.core.enums.config.HorizontalResolution;
import com.seibel.lod.core.enums.config.LightGenerationMode;
import com.seibel.lod.core.enums.config.VanillaOverdraw;
import com.seibel.lod.core.enums.config.VerticalQuality;
import com.seibel.lod.core.enums.rendering.DebugMode;
@@ -194,13 +195,11 @@ public interface ILodConfigWrapperSingleton
FogColorMode getFogColorMode();
void setFogColorMode(FogColorMode newFogColorMode);
boolean DISABLE_VANILLA_FOG_DEFAULT = false;
boolean DISABLE_VANILLA_FOG_DEFAULT = true;
String DISABLE_VANILLA_FOG_DESC = ""
+ " If true disable Minecraft's fog. \n"
+ "\n"
+ " Experimental! Will cause issues with Sodium and \n"
+ " may not play nice with other mods that edit fog. \n"
+ " Intended for those who do not use Sodium or Optifine.";
+ " Experimental! Mod support is not guarantee.";
boolean getDisableVanillaFog();
void setDisableVanillaFog(boolean newDisableVanillaFog);
}
@@ -290,14 +289,14 @@ public interface ILodConfigWrapperSingleton
+ " This setting shouldn't affect performance. \n";
VanillaOverdraw getVanillaOverdraw();
void setVanillaOverdraw(VanillaOverdraw newVanillaOverdraw);
/* Disabled for now due to implementation issues.
MinDefaultMax<Integer> VANILLA_CULLING_RANGE_MIN_DEFAULT_MAX = new MinDefaultMax<Integer>(0, 32, 512);
String VANILLA_CULLING_RANGE_DESC = ""
+ " This indicates the minimum range where back sides of blocks start get get culled. \n"
+ " Higher settings will make terrain look good when looking backwards \n"
+ " when changing speeds quickly, but will increase upload times and GPU usage.";
int getBacksideCullingRange();
void setBacksideCullingRange(int newBacksideCullingRange);
void setBacksideCullingRange(int newBacksideCullingRange);*/
boolean USE_EXTENDED_NEAR_CLIP_PLANE_DEFAULT = false;
String USE_EXTENDED_NEAR_CLIP_PLANE_DESC = ""
@@ -319,31 +318,18 @@ public interface ILodConfigWrapperSingleton
interface IWorldGenerator
{
String DESC = "These settings control how fake chunks outside your normal view range are generated.";
GenerationPriority GENERATION_PRIORITY_DEFAULT = GenerationPriority.NEAR_FIRST;
String GENERATION_PRIORITY_DESC = ""
+ " In what order should fake chunks be generated outside the vanilla render distance? \n"
boolean ENABLE_DISTANT_GENERATION_DEFAULT = true;
String ENABLE_DISTANT_GENERATION_DESC = ""
+ " Whether to enable Distant chunks generator? \n"
+ "\n"
+ " " + GenerationPriority.FAR_FIRST + " \n"
+ " Fake chunks are generated from lowest to highest detail \n"
+ " with a small priority for far away regions. \n"
+ " This fills in the world fastest, but you will have large low detail \n"
+ " blocks for a while while the generation happens. \n"
+ " Turning this on allows Distant Horizons to make lods for chunks \n"
+ " that are outside of vanilla view distance. \n"
+ "\n"
+ " " + GenerationPriority.NEAR_FIRST + " \n"
+ " Fake chunks are generated around the player \n"
+ " in a spiral, similar to vanilla minecraft. \n"
+ " Best used when on a server since we can't generate \n"
+ " fake chunks. \n"
+ "\n"
+ " " + GenerationPriority.AUTO + " \n"
+ " Uses " + GenerationPriority.FAR_FIRST + " when on a single player world \n"
+ " and " + GenerationPriority.NEAR_FIRST + " when connected to a server. \n"
+ "\n"
+ " This shouldn't affect performance.";
GenerationPriority getGenerationPriority();
void setGenerationPriority(GenerationPriority newGenerationPriority);
+ " Note that in server, distant generation is always off. \n";
boolean getEnableDistantGeneration();
void setEnableDistantGeneration(boolean newEnableDistantGeneration);
DistanceGenerationMode DISTANCE_GENERATION_MODE_DEFAULT = DistanceGenerationMode.SURFACE;
static String getDistanceGenerationModeDesc(IVersionConstants versionConstants)
{
@@ -354,10 +340,10 @@ public interface ILodConfigWrapperSingleton
+ " one chunk in Minecraft 1.16.5 and may be inaccurate for different Minecraft versions. \n"
+ " They are included to give a rough estimate as to how the different options \n"
+ " may perform in comparison to each other. \n"
+ " (Note that all modes will load in already existing chunks) \n"
+ "\n"
+ " " + DistanceGenerationMode.NONE + " \n"
+ " Don't run the distance generator. \n"
+ " No CPU usage - Fastest \n"
+ " Only run the Generator to load in already existing chunks. \n"
+ "\n"
+ " " + DistanceGenerationMode.BIOME_ONLY + " \n"
+ " Only generate the biomes and use the biome's \n"
@@ -396,7 +382,53 @@ public interface ILodConfigWrapperSingleton
DistanceGenerationMode getDistanceGenerationMode();
void setDistanceGenerationMode(DistanceGenerationMode newDistanceGenerationMode);
LightGenerationMode LIGHT_GENERATION_MODE_DEFAULT = LightGenerationMode.FANCY;
String LIGHT_GENERATION_MODE_DESC = ""
+ " How should block and sky lights be processed for distant generation? \n"
+ "\n"
+ " Note that this include already existing chunks since vanilla \n"
+ " does not store sky light values to save file. \n"
+ "\n"
+ " " + LightGenerationMode.FAST + ": Use height map to fake the light values. \n"
+ " " + LightGenerationMode.FANCY + ": Use actaul light engines to generate proper values. \n"
+ "\n"
+ " This will effect generation speed, but not the rendering performance.";
LightGenerationMode getLightGenerationMode();
void setLightGenerationMode(LightGenerationMode newLightGenerationMode);
GenerationPriority GENERATION_PRIORITY_DEFAULT = GenerationPriority.NEAR_FIRST;
String GENERATION_PRIORITY_DESC = ""
+ " In what priority should fake chunks be generated outside the vanilla render distance? \n"
+ "\n"
+ " " + GenerationPriority.FAR_FIRST + " \n"
+ " Fake chunks are generated from lowest to highest detail \n"
+ " with a priority for far away regions. \n"
+ " This fills in the world fastest, but you will have large low detail \n"
+ " blocks for a while while the generation happens. \n"
+ "\n"
+ " " + GenerationPriority.NEAR_FIRST + " \n"
+ " Fake chunks are generated around the player \n"
+ " in a spiral, similar to vanilla minecraft. \n"
+ " Best used when on a server since we can't generate \n"
+ " fake chunks. \n"
+ "\n"
+ " " + GenerationPriority.BALANCED + " \n"
+ " A mix between "+GenerationPriority.NEAR_FIRST+"and"+GenerationPriority.FAR_FIRST+". \n"
+ " First prioritise completing nearby highest detail chunks, \n"
+ " then focus on filling in the low detail areas away from the player. \n"
+ "\n"
+ " " + GenerationPriority.AUTO + " \n"
+ " Uses " + GenerationPriority.BALANCED + " when on a single player world \n"
+ " and " + GenerationPriority.NEAR_FIRST + " when connected to a server. \n"
+ "\n"
+ " This shouldn't affect performance.";
GenerationPriority getGenerationPriority();
void setGenerationPriority(GenerationPriority newGenerationPriority);
@Deprecated
boolean ALLOW_UNSTABLE_FEATURE_GENERATION_DEFAULT = false;
@Deprecated
String ALLOW_UNSTABLE_FEATURE_GENERATION_DESC = ""
+ " When using the " + DistanceGenerationMode.FEATURES + " generation mode \n"
+ " some features may not be thread safe, which could \n"
@@ -413,8 +445,10 @@ public interface ILodConfigWrapperSingleton
+ " but I'm not sure how to do that. \n"
+ " If you are a Java wizard, check out the git issue here: \n"
+ " https://gitlab.com/jeseibel/minecraft-lod-mod/-/issues/35 \n";
boolean getAllowUnstableFeatureGeneration();
void setAllowUnstableFeatureGeneration(boolean newAllowUnstableFeatureGeneration);
@Deprecated
default boolean getAllowUnstableFeatureGeneration() {return true;}
@Deprecated
default void setAllowUnstableFeatureGeneration(boolean newAllowUnstableFeatureGeneration) {return;}
BlocksToAvoid BLOCKS_TO_AVOID_DEFAULT = BlocksToAvoid.BOTH;
String BLOCKS_TO_AVOID_DESC = ""
@@ -522,7 +556,9 @@ public interface ILodConfigWrapperSingleton
+ "\n"
+ " " + DebugMode.OFF + ": Fake chunks will be drawn with their normal colors. \n"
+ " " + DebugMode.SHOW_DETAIL + ": Fake chunks color will be based on their detail level. \n"
+ " " + DebugMode.SHOW_DETAIL_WIREFRAME + ": Fake chunks color will be based on their detail level, drawn as a wireframe. \n";
+ " " + DebugMode.SHOW_DETAIL_WIREFRAME + ": Fake chunks color will be based on their detail level, drawn as a wireframe. \n"
+ " " + DebugMode.SHOW_GENMODE + ": Fake chunks color will be based on their distant generation mode. \n"
+ " " + DebugMode.SHOW_GENMODE_WIREFRAME + ": Fake chunks color will be based on their distant generation mode, drawn as a wireframe. \n";
DebugMode getDebugMode();
void setDebugMode(DebugMode newDebugMode);
@@ -57,6 +57,10 @@
"DistantHorizons.config.client.worldGenerator.allowUnstableFeatureGeneration.@tooltip": "Some features may not be thread safe. \nCould cause instability and crashes",
"DistantHorizons.config.client.worldGenerator.blocksToAvoid": "Block to avoid",
"DistantHorizons.config.client.worldGenerator.blocksToAvoid.@tooltip": "What block to avoid when generating fake chunks",
"DistantHorizons.config.client.worldGenerator.enableDistantGeneration": "Enable Distant Generation",
"DistantHorizons.config.client.worldGenerator.enableDistantGeneration.@tooltip": "Whether to enable Distant chunks generator?",
"DistantHorizons.config.client.worldGenerator.lightGenerationMode": "Light Generation Mode",
"DistantHorizons.config.client.worldGenerator.lightGenerationMode.@tooltip": "How should block and sky lights be processed for distant generation?",
"DistantHorizons.config.client.advanced": "Advance options",
"DistantHorizons.config.client.advanced.threading": "Threading",
"DistantHorizons.config.client.advanced.threading.numberOfWorldGenerationThreads": "NO. of world generation threads",
@@ -135,5 +139,7 @@
"DistantHorizons.config.enum.BufferRebuildTimes.RARE": "Rare",
"DistantHorizons.config.enum.DropoffQuality.AUTO": "Auto",
"DistantHorizons.config.enum.DropoffQuality.SMOOTH_DROPOFF": "Smooth dropoff",
"DistantHorizons.config.enum.DropoffQuality.PERFORMANCE_FOCUSED": "Performance focused"
"DistantHorizons.config.enum.DropoffQuality.PERFORMANCE_FOCUSED": "Performance focused",
"DistantHorizons.config.enum.LightGenerationMode.FAST": "Fast",
"DistantHorizons.config.enum.LightGenerationMode.FANCY": "Fancy"
}