Prepend "E" to all enums

Similar to how "I" is prepended to all interfaces.

Also Intellij appears to have removed some unneeded imports.
This commit is contained in:
James Seibel
2022-06-09 21:07:08 -05:00
parent fb83a2eaf9
commit 6a15705b51
85 changed files with 811 additions and 833 deletions
@@ -27,5 +27,5 @@ package com.seibel.lod.core.api.external.apiObjects.enums;
*/
public class DhApiEnumAssembly
{
public static final String API_ENUM_PREFIX = "DhApi";
public static final String API_ENUM_PREFIX = "EDhApi";
}
@@ -26,7 +26,7 @@ package com.seibel.lod.core.api.external.apiObjects.enums;
* @author James Seibel
* @version 2022-6-9
*/
public enum DhApiFogColorMode
public enum EDhApiFogColorMode
{
// Reminder:
// when adding items up the API minor version
@@ -24,7 +24,7 @@ package com.seibel.lod.core.api.external.apiObjects.enums;
* @author Leonardo Amato
* @version 2022-6-9
*/
public enum DhApiVerticalQuality
public enum EDhApiVerticalQuality
{
// Reminder:
// when adding items: up the API minor version
@@ -1,10 +1,10 @@
package com.seibel.lod.core.api.external.config.client.graphics;
import com.seibel.lod.core.enums.rendering.FogColorMode;
import com.seibel.lod.core.enums.rendering.FogDistance;
import com.seibel.lod.core.enums.rendering.EFogColorMode;
import com.seibel.lod.core.enums.rendering.EFogDistance;
import com.seibel.lod.core.api.external.apiObjects.objects.DhApiConfig_v1;
import com.seibel.lod.core.config.Config.Client.Graphics.FogQuality;
import com.seibel.lod.core.enums.rendering.FogDrawMode;
import com.seibel.lod.core.enums.rendering.EFogDrawMode;
/**
* Any graphics settings related to fog.
@@ -16,15 +16,15 @@ public class DhApiGraphicsFog
{
/** Returns the config related to when fog is rendered. */
public static DhApiConfig_v1<FogDistance> getFogDistanceConfig_v1()
public static DhApiConfig_v1<EFogDistance> getFogDistanceConfig_v1()
{ return new DhApiConfig_v1<>(FogQuality.fogDistance); }
/** Returns the config related to when fog is rendered. */
public static DhApiConfig_v1<FogDrawMode> getFogRenderConfig_v1()
public static DhApiConfig_v1<EFogDrawMode> getFogRenderConfig_v1()
{ return new DhApiConfig_v1<>(FogQuality.fogDrawMode); }
/** Returns the config related to the fog draw type. */
public static DhApiConfig_v1<FogColorMode> getFogColorConfig_v1()
public static DhApiConfig_v1<EFogColorMode> getFogColorConfig_v1()
{ return new DhApiConfig_v1<>(FogQuality.fogColorMode); }
/** Returns the config related to disabling vanilla fog. */
@@ -1,7 +1,7 @@
package com.seibel.lod.core.api.external.config.client.graphics;
import com.seibel.lod.core.api.external.apiObjects.objects.DhApiConfig_v1;
import com.seibel.lod.core.enums.rendering.RendererType;
import com.seibel.lod.core.enums.rendering.ERendererType;
import com.seibel.lod.core.config.Config.Client.Graphics.Quality;
import com.seibel.lod.core.config.Config.Client.Advanced.Debugging;
@@ -22,7 +22,7 @@ public class DhApiGraphicsGeneral
{ return new DhApiConfig_v1<>(Quality.lodChunkRenderDistance); }
/** Returns the config related to how Distant Horizons is set to render. */
public static DhApiConfig_v1<RendererType> getRenderingTypeConfig_v1()
public static DhApiConfig_v1<ERendererType> getRenderingTypeConfig_v1()
{ return new DhApiConfig_v1<>(Debugging.rendererType); }
}
@@ -24,7 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import com.seibel.lod.core.builders.lodBuilding.LodBuilder;
import com.seibel.lod.core.enums.rendering.RendererType;
import com.seibel.lod.core.enums.rendering.ERendererType;
import com.seibel.lod.core.logging.ConfigBasedLogger;
import com.seibel.lod.core.logging.ConfigBasedSpamLogger;
import com.seibel.lod.core.objects.DHChunkPos;
@@ -37,7 +37,7 @@ import org.lwjgl.glfw.GLFW;
import com.seibel.lod.core.ModInfo;
import com.seibel.lod.core.builders.lodBuilding.bufferBuilding.LodBufferBuilderFactory;
import com.seibel.lod.core.enums.config.DistanceGenerationMode;
import com.seibel.lod.core.enums.config.EDistanceGenerationMode;
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
import com.seibel.lod.core.objects.lod.LodDimension;
import com.seibel.lod.core.objects.math.Mat4f;
@@ -234,7 +234,7 @@ public class ClientApi
generating.add(pos);
//ApiShared.LOGGER.info("Lod Generation trying "+pos+". Remaining: " +toBeLoaded.size());
InternalApiShared.lodBuilder.generateLodNodeAsync(chunk, InternalApiShared.lodWorld,
world.getDimensionType(), DistanceGenerationMode.FULL, true, true, () -> {
world.getDimensionType(), EDistanceGenerationMode.FULL, true, true, () -> {
generating.remove(pos);
LodBuilder.EVENT_LOGGER.debug("Manual Chunk: {} done. Remaining queue: {}", pos, toBeLoaded.size());
}, () -> {
@@ -264,7 +264,7 @@ public class ClientApi
if (CONFIG.client().advanced().debugging().getRendererType() == RendererType.DEFAULT)
if (CONFIG.client().advanced().debugging().getRendererType() == ERendererType.DEFAULT)
{
// Note to self:
// if "unspecified" shows up in the pie chart, it is
@@ -290,7 +290,7 @@ public class ClientApi
}
profiler.pop(); // end LOD
profiler.push("terrain"); // go back into "terrain"
} else if (CONFIG.client().advanced().debugging().getRendererType() == RendererType.DEBUG) {
} else if (CONFIG.client().advanced().debugging().getRendererType() == ERendererType.DEBUG) {
IProfilerWrapper profiler = MC.getProfiler();
profiler.pop(); // get out of "terrain"
profiler.push("LODTestRendering");
@@ -359,7 +359,7 @@ public class ClientApi
if (glfwKey == GLFW.GLFW_KEY_F6)
{
CONFIG.client().advanced().debugging()
.setRendererType(RendererType.next(CONFIG.client().advanced().debugging().getRendererType()));
.setRendererType(ERendererType.next(CONFIG.client().advanced().debugging().getRendererType()));
MC.sendChatMessage("F6: Set rendering to " + CONFIG.client().advanced().debugging().getRendererType());
}
@@ -21,7 +21,7 @@ package com.seibel.lod.core.api.internal;
import com.seibel.lod.core.builders.lodBuilding.LodBuilder;
import com.seibel.lod.core.builders.worldGeneration.BatchGenerator;
import com.seibel.lod.core.enums.WorldType;
import com.seibel.lod.core.enums.EWorldType;
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
import com.seibel.lod.core.logging.DhLoggerBuilder;
import com.seibel.lod.core.objects.DHChunkPos;
@@ -130,14 +130,14 @@ public class EventApi
if (ENABLE_STACK_DUMP_LOGGING)
LOGGER.info(
"WorldLoadEvent called here for "
+ (world.getWorldType() == WorldType.ClientWorld ? "clientLevel" : "serverLevel"),
+ (world.getWorldType() == EWorldType.ClientWorld ? "clientLevel" : "serverLevel"),
new RuntimeException());
// Always ignore ServerWorld event
if (world.getWorldType() == WorldType.ServerWorld)
if (world.getWorldType() == EWorldType.ServerWorld)
return;
isCurrentlyOnSinglePlayerServer = MC.hasSinglePlayerServer();
if (!InternalApiShared.isShuttingDown) LOGGER.warn("WorldLoadEvent called on {} while another world is loaded!",
(world.getWorldType() == WorldType.ClientWorld ? "clientLevel" : "serverLevel"));
(world.getWorldType() == EWorldType.ClientWorld ? "clientLevel" : "serverLevel"));
InternalApiShared.isShuttingDown = false;
//DataPointUtil.WORLD_HEIGHT = world.getHeight();
LodBuilder.MIN_WORLD_HEIGHT = world.getMinHeight(); // This updates the World height
@@ -163,13 +163,13 @@ public class EventApi
if (ENABLE_STACK_DUMP_LOGGING)
LOGGER.info(
"WorldUnloadEvent called here for "
+ (world.getWorldType() == WorldType.ClientWorld ? "clientLevel" : "serverLevel"),
+ (world.getWorldType() == EWorldType.ClientWorld ? "clientLevel" : "serverLevel"),
new RuntimeException());
// If it's single player, ignore the client side world unload event
// Note: using isCurrentlyOnSinglePlayerServer as often API call unload event
// AFTER setting MC to not be in a singlePlayerServer
if (isCurrentlyOnSinglePlayerServer && world.getWorldType() == WorldType.ClientWorld)
if (isCurrentlyOnSinglePlayerServer && world.getWorldType() == EWorldType.ClientWorld)
return;
// if this isn't done unfinished tasks may be left in the queue
@@ -20,7 +20,7 @@
package com.seibel.lod.core.api.internal;
import com.seibel.lod.core.builders.lodBuilding.LodBuilder;
import com.seibel.lod.core.enums.config.VerticalQuality;
import com.seibel.lod.core.enums.config.EVerticalQuality;
import com.seibel.lod.core.objects.lod.LodWorld;
/**
@@ -46,7 +46,7 @@ public class InternalApiShared
public static int previousChunkRenderDistance = 0;
/** Used to determine if the LODs should be regenerated */
public static int previousLodRenderDistance = 0;
public static VerticalQuality previousVertQual = null;
public static EVerticalQuality previousVertQual = null;
/** Signal whether a world is shutting down */
public static volatile boolean isShuttingDown = false;
@@ -21,8 +21,8 @@ package com.seibel.lod.core.api.internal.a7;
import com.seibel.lod.core.config.Config;
import com.seibel.lod.core.ModInfo;
import com.seibel.lod.core.enums.rendering.DebugMode;
import com.seibel.lod.core.enums.rendering.RendererType;
import com.seibel.lod.core.enums.rendering.EDebugMode;
import com.seibel.lod.core.enums.rendering.ERendererType;
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
import com.seibel.lod.core.logging.ConfigBasedLogger;
import com.seibel.lod.core.logging.ConfigBasedSpamLogger;
@@ -211,7 +211,7 @@ public class ClientApi
level.asyncTick();
}
if (Config.Client.Advanced.Debugging.rendererType.get() == RendererType.DEFAULT) {
if (Config.Client.Advanced.Debugging.rendererType.get() == ERendererType.DEFAULT) {
if (MC_RENDER.playerHasBlindnessEffect()) {
// if the player is blind, don't render LODs,
// and don't change minecraft's fog
@@ -237,7 +237,7 @@ public class ClientApi
}
}
profiler.pop(); // "Render-Lods"
} else if (Config.Client.Advanced.Debugging.rendererType.get() == RendererType.DEBUG) {
} else if (Config.Client.Advanced.Debugging.rendererType.get() == ERendererType.DEBUG) {
profiler.push("Render-Test");
try {
ClientApi.testRenderer.render();
@@ -288,12 +288,12 @@ public class ClientApi
if (glfwKey == GLFW.GLFW_KEY_F8)
{
Config.Client.Advanced.Debugging.debugMode.set(DebugMode.next(Config.Client.Advanced.Debugging.debugMode.get()));
Config.Client.Advanced.Debugging.debugMode.set(EDebugMode.next(Config.Client.Advanced.Debugging.debugMode.get()));
MC.sendChatMessage("F8: Set debug mode to " + Config.Client.Advanced.Debugging.debugMode.get());
}
if (glfwKey == GLFW.GLFW_KEY_F6)
{
Config.Client.Advanced.Debugging.rendererType.set(RendererType.next(Config.Client.Advanced.Debugging.rendererType.get()));
Config.Client.Advanced.Debugging.rendererType.set(ERendererType.next(Config.Client.Advanced.Debugging.rendererType.get()));
MC.sendChatMessage("F6: Set rendering to " + Config.Client.Advanced.Debugging.rendererType.get());
}
if (glfwKey == GLFW.GLFW_KEY_P)
@@ -23,9 +23,9 @@ import java.util.ConcurrentModificationException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import com.seibel.lod.core.enums.LodDirection;
import com.seibel.lod.core.enums.config.BlocksToAvoid;
import com.seibel.lod.core.enums.config.DistanceGenerationMode;
import com.seibel.lod.core.enums.ELodDirection;
import com.seibel.lod.core.enums.config.EBlocksToAvoid;
import com.seibel.lod.core.enums.config.EDistanceGenerationMode;
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
import com.seibel.lod.core.logging.ConfigBasedLogger;
import com.seibel.lod.core.objects.DHBlockPos;
@@ -96,12 +96,12 @@ public class LodBuilder
public void generateLodNodeAsync(IChunkWrapper chunk, LodWorld lodWorld, IDimensionTypeWrapper dim, boolean genAll)
{
// Block change event
generateLodNodeAsync(chunk, lodWorld, dim, DistanceGenerationMode.FULL, true, genAll, ()->{},
generateLodNodeAsync(chunk, lodWorld, dim, EDistanceGenerationMode.FULL, true, genAll, ()->{},
()->{generateLodNodeAsync(chunk,lodWorld,dim, genAll);});
}
public void generateLodNodeAsync(IChunkWrapper chunk, LodWorld lodWorld, IDimensionTypeWrapper dim,
DistanceGenerationMode generationMode, boolean override, boolean genAll, Runnable endCallback, Runnable retryCallback)
EDistanceGenerationMode generationMode, boolean override, boolean genAll, Runnable endCallback, Runnable retryCallback)
{
if (lodWorld == null || lodWorld.getIsWorldNotLoaded()) {
endCallback.run();
@@ -366,18 +366,18 @@ public class LodBuilder
System.arraycopy(result, 0, data, dataOffset, maxVerticalData);
}
public static final LodDirection[] DIRECTIONS = new LodDirection[] {
LodDirection.UP,
LodDirection.DOWN,
LodDirection.WEST,
LodDirection.EAST,
LodDirection.NORTH,
LodDirection.SOUTH };
public static final ELodDirection[] DIRECTIONS = new ELodDirection[] {
ELodDirection.UP,
ELodDirection.DOWN,
ELodDirection.WEST,
ELodDirection.EAST,
ELodDirection.NORTH,
ELodDirection.SOUTH };
private boolean hasCliffFace(IChunkWrapper chunk, int x, int y, int z) {
for (LodDirection dir : DIRECTIONS) {
for (ELodDirection dir : DIRECTIONS) {
IBlockDetailWrapper block = chunk.getBlockDetailAtFace(x, y, z, dir);
if (block == null || !block.hasFaceCullingFor(LodDirection.OPPOSITE_DIRECTIONS[dir.ordinal()]))
if (block == null || !block.hasFaceCullingFor(ELodDirection.OPPOSITE_DIRECTIONS[dir.ordinal()]))
return true;
}
return false;
@@ -555,14 +555,14 @@ public class LodBuilder
/** Is the block at the given blockPos a valid LOD point? */
private boolean isLayerValidLodPoint(IBlockDetailWrapper blockDetail)
{
BlocksToAvoid avoid = config.client().worldGenerator().getBlocksToAvoid();
EBlocksToAvoid avoid = config.client().worldGenerator().getBlocksToAvoid();
return blockDetail != null && blockDetail.shouldRender(avoid);
}
/** Is the block at the given blockPos a valid LOD point? */
private boolean isLayerValidLodPoint(IChunkWrapper chunk, int x, int y, int z)
{
BlocksToAvoid avoid = config.client().worldGenerator().getBlocksToAvoid();
EBlocksToAvoid avoid = config.client().worldGenerator().getBlocksToAvoid();
IBlockDetailWrapper block = chunk.getBlockDetail(x, y, z);
return block != null && block.shouldRender(avoid);
}
@@ -19,7 +19,7 @@
package com.seibel.lod.core.builders.lodBuilding;
import com.seibel.lod.core.enums.config.DistanceGenerationMode;
import com.seibel.lod.core.enums.config.EDistanceGenerationMode;
/**
* This is used to easily configure how LodChunks are generated.
@@ -38,7 +38,7 @@ public class LodBuilderConfig
/** default: true */
public boolean useSolidBlocksInColorGen;
/** default: server */
public DistanceGenerationMode distanceGenerationMode;
public EDistanceGenerationMode distanceGenerationMode;
public boolean quickFillWithVoid;
/**
@@ -48,7 +48,7 @@ public class LodBuilderConfig
* useSolidBlocksInColorGen = true <br>
* generationMode = Server <br>
*/
public LodBuilderConfig(DistanceGenerationMode newDistanceGenerationMode)
public LodBuilderConfig(EDistanceGenerationMode newDistanceGenerationMode)
{
useHeightmap = false;
useBiomeColors = false;
@@ -58,7 +58,7 @@ public class LodBuilderConfig
}
public static LodBuilderConfig getFillVoidConfig() {
LodBuilderConfig config = new LodBuilderConfig(DistanceGenerationMode.NONE);
LodBuilderConfig config = new LodBuilderConfig(EDistanceGenerationMode.NONE);
config.quickFillWithVoid = true;
return config;
}
@@ -19,10 +19,7 @@
package com.seibel.lod.core.builders.lodBuilding.bufferBuilding;
import com.seibel.lod.core.enums.LodDirection;
import com.seibel.lod.core.util.ColorUtil;
import static com.seibel.lod.core.render.LodRenderer.EVENT_LOGGER;
import com.seibel.lod.core.enums.ELodDirection;
/**
* Represents a renderable quad.
@@ -42,13 +39,13 @@ public final class BufferQuad
final int color;
final byte skyLight;
final byte blockLight;
final LodDirection direction;
final ELodDirection direction;
boolean hasError = false;
BufferQuad(short x, short y, short z, short widthEastWest, short widthNorthSouthOrUpDown,
int color, byte skylight, byte blocklight,
LodDirection direction)
ELodDirection direction)
{
if (widthEastWest == 0 || widthNorthSouthOrUpDown == 0)
throw new IllegalArgumentException("Size 0 quad!");
@@ -19,7 +19,7 @@
package com.seibel.lod.core.builders.lodBuilding.bufferBuilding;
import com.seibel.lod.core.enums.rendering.DebugMode;
import com.seibel.lod.core.enums.rendering.EDebugMode;
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
import com.seibel.lod.core.objects.LodDataView;
import com.seibel.lod.core.objects.a7.datatype.column.ColumnArrayView;
@@ -41,7 +41,7 @@ public class CubicLodTemplate
private static final ILodConfigWrapperSingleton CONFIG = SingletonHandler.get(ILodConfigWrapperSingleton.class);
public static void addLodToBuffer(long data, long topData, long botData, LodDataView[][] adjData,
boolean[] adjFillBlack, byte detailLevel, int offsetPosX, int offsetOosZ, LodQuadBuilder quadBuilder, DebugMode debugging)
boolean[] adjFillBlack, byte detailLevel, int offsetPosX, int offsetOosZ, LodQuadBuilder quadBuilder, EDebugMode debugging)
{
short width = (short) (1 << detailLevel);
short x = (short) LevelPosUtil.convert(detailLevel, offsetPosX, LodUtil.BLOCK_DETAIL_LEVEL);
@@ -107,7 +107,7 @@ public class CubicLodTemplate
topData, botData, adjData, adjFillBlack); // setAdjData
}
public static void addLodToBuffer(long data, long topData, long botData, ColumnArrayView[][] adjData, byte detailLevel, int offsetPosX, int offsetOosZ, LodQuadBuilder quadBuilder, DebugMode debugging)
public static void addLodToBuffer(long data, long topData, long botData, ColumnArrayView[][] adjData, byte detailLevel, int offsetPosX, int offsetOosZ, LodQuadBuilder quadBuilder, EDebugMode debugging)
{
short width = (short) (1 << detailLevel);
short x = (short) LevelPosUtil.convert(detailLevel, offsetPosX, LodUtil.BLOCK_DETAIL_LEVEL);
@@ -25,20 +25,16 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.ListIterator;
import com.seibel.lod.core.api.internal.EventApi;
import com.seibel.lod.core.api.internal.InternalApiShared;
import com.seibel.lod.core.builders.lodBuilding.LodBuilder;
import com.seibel.lod.core.enums.LodDirection;
import com.seibel.lod.core.enums.LodDirection.Axis;
import com.seibel.lod.core.enums.config.GpuUploadMethod;
import com.seibel.lod.core.enums.ELodDirection;
import com.seibel.lod.core.enums.ELodDirection.Axis;
import com.seibel.lod.core.enums.config.EGpuUploadMethod;
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
import com.seibel.lod.core.logging.DhLoggerBuilder;
import com.seibel.lod.core.render.LodRenderer;
import com.seibel.lod.core.render.objects.GLVertexBuffer;
import com.seibel.lod.core.util.ColorUtil;
import com.seibel.lod.core.util.LodUtil;
import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton;
import net.minecraft.core.Direction;
import static com.seibel.lod.core.render.LodRenderer.EVENT_LOGGER;
@@ -181,11 +177,11 @@ public class LodQuadBuilder
public void addQuadAdj(LodDirection dir, short x, short y, short z,
public void addQuadAdj(ELodDirection dir, short x, short y, short z,
short widthEastWest, short widthNorthSouthOrUpDown,
int color, byte skylight, byte blocklight)
{
if (dir.ordinal() <= LodDirection.DOWN.ordinal())
if (dir.ordinal() <= ELodDirection.DOWN.ordinal())
throw new IllegalArgumentException("addQuadAdj() is only for adj direction! Not UP or Down!");
if (skipQuadsWithZeroSkylight && skylight == 0 && y < skyLightCullingBelow)
return;
@@ -206,8 +202,8 @@ public class LodQuadBuilder
{
if (skipQuadsWithZeroSkylight && skylight == 0 && y < skyLightCullingBelow)
return;
BufferQuad quad = new BufferQuad(x, y, z, width, wz, color, skylight, blocklight, LodDirection.UP);
ArrayList<BufferQuad> qs = quads[LodDirection.UP.ordinal()];
BufferQuad quad = new BufferQuad(x, y, z, width, wz, color, skylight, blocklight, ELodDirection.UP);
ArrayList<BufferQuad> qs = quads[ELodDirection.UP.ordinal()];
if (!qs.isEmpty() &&
(qs.get(qs.size()-1).tryMerge(quad, BufferMergeDirectionEnum.EastWest)
|| qs.get(qs.size()-1).tryMerge(quad, BufferMergeDirectionEnum.NorthSouthOrUpDown))
@@ -222,8 +218,8 @@ public class LodQuadBuilder
{
if (skipQuadsWithZeroSkylight && skylight == 0 && y < skyLightCullingBelow)
return;
BufferQuad quad = new BufferQuad(x, y, z, width, wz, color, skylight, blocklight, LodDirection.DOWN);
ArrayList<BufferQuad> qs = quads[LodDirection.DOWN.ordinal()];
BufferQuad quad = new BufferQuad(x, y, z, width, wz, color, skylight, blocklight, ELodDirection.DOWN);
ArrayList<BufferQuad> qs = quads[ELodDirection.DOWN.ordinal()];
if (!qs.isEmpty() &&
(qs.get(qs.size()-1).tryMerge(quad, BufferMergeDirectionEnum.EastWest)
|| qs.get(qs.size()-1).tryMerge(quad, BufferMergeDirectionEnum.NorthSouthOrUpDown))
@@ -442,7 +438,7 @@ public class LodQuadBuilder
boolean fill(GLVertexBuffer vbo);
}
public BufferFiller makeBufferFiller(GpuUploadMethod method)
public BufferFiller makeBufferFiller(EGpuUploadMethod method)
{
return new BufferFiller()
{
@@ -19,10 +19,9 @@
package com.seibel.lod.core.builders.worldGeneration;
import com.seibel.lod.core.api.internal.InternalApiShared;
import com.seibel.lod.core.builders.lodBuilding.LodBuilder;
import com.seibel.lod.core.enums.config.DistanceGenerationMode;
import com.seibel.lod.core.enums.config.GenerationPriority;
import com.seibel.lod.core.enums.config.EDistanceGenerationMode;
import com.seibel.lod.core.enums.config.EGenerationPriority;
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
import com.seibel.lod.core.logging.DhLoggerBuilder;
import com.seibel.lod.core.objects.PosToGenerateContainer;
@@ -73,7 +72,7 @@ public class BatchGenerator
LOGGER.info("1.18 Experimental Chunk Generator reinitialized");
}
DistanceGenerationMode mode = CONFIG.client().worldGenerator().getDistanceGenerationMode();
EDistanceGenerationMode mode = CONFIG.client().worldGenerator().getDistanceGenerationMode();
int newThreadCount = CONFIG.client().advanced().threading()._getWorldGenerationThreadPoolSize();
if (newThreadCount != previousThreadCount) {
generationGroup.resizeThreadPool(newThreadCount);
@@ -82,9 +81,9 @@ public class BatchGenerator
if (estimatedPointsToQueue < newThreadCount)
estimatedPointsToQueue = newThreadCount;
GenerationPriority priority = CONFIG.client().worldGenerator().getGenerationPriority();
if (priority == GenerationPriority.AUTO)
priority = MC.hasSinglePlayerServer() ? GenerationPriority.FAR_FIRST : GenerationPriority.NEAR_FIRST;
EGenerationPriority priority = CONFIG.client().worldGenerator().getGenerationPriority();
if (priority == EGenerationPriority.AUTO)
priority = MC.hasSinglePlayerServer() ? EGenerationPriority.FAR_FIRST : EGenerationPriority.NEAR_FIRST;
generationGroup.updateAllFutures();
if (!MC.hasSinglePlayerServer())
@@ -149,7 +148,7 @@ public class BatchGenerator
if (ENABLE_GENERATOR_STATS_LOGGING)
LOGGER.info("WorldGen. Near:" + posToGenerate.getNumberOfNearPos() + " Far:"
+ posToGenerate.getNumberOfFarPos());
if (priority == GenerationPriority.FAR_FIRST || priority == GenerationPriority.BALANCED) {
if (priority == EGenerationPriority.FAR_FIRST || priority == EGenerationPriority.BALANCED) {
int nearCount = posToGenerate.getNumberOfNearPos();
int farCount = posToGenerate.getNumberOfFarPos();
@@ -20,10 +20,10 @@
package com.seibel.lod.core.config;
import com.seibel.lod.core.enums.rendering.FogDrawMode;
import com.seibel.lod.core.enums.rendering.FogColorMode;
import com.seibel.lod.core.enums.rendering.FogDistance;
import com.seibel.lod.core.enums.rendering.RendererType;
import com.seibel.lod.core.enums.rendering.EFogDrawMode;
import com.seibel.lod.core.enums.rendering.EFogColorMode;
import com.seibel.lod.core.enums.rendering.EFogDistance;
import com.seibel.lod.core.enums.rendering.ERendererType;
import com.seibel.lod.core.config.types.*;
import com.seibel.lod.core.enums.config.*;
@@ -85,21 +85,21 @@ public class Config
public static class Quality
{
public static ConfigEntry<HorizontalResolution> drawResolution = new ConfigEntry.Builder<HorizontalResolution>()
.set(HorizontalResolution.BLOCK)
public static ConfigEntry<EHorizontalResolution> drawResolution = new ConfigEntry.Builder<EHorizontalResolution>()
.set(EHorizontalResolution.BLOCK)
.comment(""
+ "What is the maximum detail fake chunks should be drawn at? \n"
+ "This setting will only affect closer chunks.\n"
+ "Higher settings will increase memory and GPU usage. \n"
+ "\n"
+ HorizontalResolution.CHUNK + ": render 1 LOD for each Chunk. \n"
+ HorizontalResolution.HALF_CHUNK + ": render 4 LODs for each Chunk. \n"
+ HorizontalResolution.FOUR_BLOCKS + ": render 16 LODs for each Chunk. \n"
+ HorizontalResolution.TWO_BLOCKS + ": render 64 LODs for each Chunk. \n"
+ HorizontalResolution.BLOCK + ": render 256 LODs for each Chunk (width of one block). \n"
+ EHorizontalResolution.CHUNK + ": render 1 LOD for each Chunk. \n"
+ EHorizontalResolution.HALF_CHUNK + ": render 4 LODs for each Chunk. \n"
+ EHorizontalResolution.FOUR_BLOCKS + ": render 16 LODs for each Chunk. \n"
+ EHorizontalResolution.TWO_BLOCKS + ": render 64 LODs for each Chunk. \n"
+ EHorizontalResolution.BLOCK + ": render 256 LODs for each Chunk (width of one block). \n"
+ "\n"
+ "Lowest Quality: " + HorizontalResolution.CHUNK + "\n"
+ "Highest Quality: " + HorizontalResolution.BLOCK)
+ "Lowest Quality: " + EHorizontalResolution.CHUNK + "\n"
+ "Highest Quality: " + EHorizontalResolution.BLOCK)
.build();
public static ConfigEntry<Integer> lodChunkRenderDistance = new ConfigEntry.Builder<Integer>()
@@ -107,20 +107,20 @@ public class Config
.comment("The radius of the mod's render distance. (measured in chunks)")
.build();
public static ConfigEntry<VerticalQuality> verticalQuality = new ConfigEntry.Builder<VerticalQuality>()
.set(VerticalQuality.MEDIUM)
public static ConfigEntry<EVerticalQuality> verticalQuality = new ConfigEntry.Builder<EVerticalQuality>()
.set(EVerticalQuality.MEDIUM)
.comment(""
+ "This indicates how detailed fake chunks will represent \n"
+ " overhangs, caves, floating islands, ect. \n"
+ "Higher options will make the world more accurate, but"
+ " will increase memory and GPU usage. \n"
+ "\n"
+ VerticalQuality.LOW + ": uses at max 2 columns per position. \n"
+ VerticalQuality.MEDIUM + ": uses at max 4 columns per position. \n"
+ VerticalQuality.HIGH + ": uses at max 8 columns per position. \n"
+ EVerticalQuality.LOW + ": uses at max 2 columns per position. \n"
+ EVerticalQuality.MEDIUM + ": uses at max 4 columns per position. \n"
+ EVerticalQuality.HIGH + ": uses at max 8 columns per position. \n"
+ "\n"
+ "Lowest Quality: " + VerticalQuality.LOW + "\n"
+ "Highest Quality: " + VerticalQuality.HIGH)
+ "Lowest Quality: " + EVerticalQuality.LOW + "\n"
+ "Highest Quality: " + EVerticalQuality.HIGH)
.build();
public static ConfigEntry<Integer> horizontalScale = new ConfigEntry.Builder<Integer>()
@@ -131,27 +131,27 @@ public class Config
+ " but will increase memory and GPU usage.")
.build();
public static ConfigEntry<HorizontalQuality> horizontalQuality = new ConfigEntry.Builder<HorizontalQuality>()
.set(HorizontalQuality.MEDIUM)
public static ConfigEntry<EHorizontalQuality> horizontalQuality = new ConfigEntry.Builder<EHorizontalQuality>()
.set(EHorizontalQuality.MEDIUM)
.comment(""
+ "This indicates how quickly fake chunks decrease in quality the further away they are. \n"
+ "Higher settings will render higher quality fake chunks farther away, \n"
+ " but will increase memory and GPU usage.")
.build();
public static ConfigEntry<DropoffQuality> dropoffQuality = new ConfigEntry.Builder<DropoffQuality>()
.set(DropoffQuality.AUTO)
public static ConfigEntry<EDropoffQuality> dropoffQuality = new ConfigEntry.Builder<EDropoffQuality>()
.set(EDropoffQuality.AUTO)
.comment(""
+ "This determines how lod level drop off will be done. \n"
+ "\n"
+ DropoffQuality.SMOOTH_DROPOFF + ": \n"
+ EDropoffQuality.SMOOTH_DROPOFF + ": \n"
+ " The lod level is calculated for each point, making the drop off a smooth circle. \n"
+ DropoffQuality.PERFORMANCE_FOCUSED + ": \n"
+ EDropoffQuality.PERFORMANCE_FOCUSED + ": \n"
+ " One detail level for an entire region. Minimize CPU usage and \n"
+ " improve terrain refresh delay, especially for high Lod render distance. \n"
+ DropoffQuality.AUTO + ": \n"
+ " Use "+ DropoffQuality.SMOOTH_DROPOFF + " for less then 128 Lod render distance, \n"
+ " or "+ DropoffQuality.PERFORMANCE_FOCUSED +" otherwise.")
+ EDropoffQuality.AUTO + ": \n"
+ " Use "+ EDropoffQuality.SMOOTH_DROPOFF + " for less then 128 Lod render distance, \n"
+ " or "+ EDropoffQuality.PERFORMANCE_FOCUSED +" otherwise.")
.build();
public static ConfigEntry<Integer> lodBiomeBlending = new ConfigEntry.Builder<Integer>()
@@ -171,34 +171,34 @@ public class Config
public static class FogQuality
{
public static ConfigEntry<FogDistance> fogDistance = new ConfigEntry.Builder<FogDistance>()
.set(FogDistance.FAR)
public static ConfigEntry<EFogDistance> fogDistance = new ConfigEntry.Builder<EFogDistance>()
.set(EFogDistance.FAR)
.comment(""
+ "At what distance should Fog be drawn on the fake chunks? \n"
+ "\n"
+ "This setting shouldn't affect performance.")
.build();
public static ConfigEntry<FogDrawMode> fogDrawMode = new ConfigEntry.Builder<FogDrawMode>()
.set(FogDrawMode.FOG_ENABLED)
public static ConfigEntry<EFogDrawMode> fogDrawMode = new ConfigEntry.Builder<EFogDrawMode>()
.set(EFogDrawMode.FOG_ENABLED)
.comment(""
+ "When should fog be drawn? \n"
+ "\n"
+ FogDrawMode.USE_OPTIFINE_SETTING + ": Use whatever Fog setting Optifine is using.\n"
+ "If Optifine isn't installed this defaults to " + FogDrawMode.FOG_ENABLED + ". \n"
+ FogDrawMode.FOG_ENABLED + ": Never draw fog on the LODs \n"
+ FogDrawMode.FOG_DISABLED + ": Always draw fast fog on the LODs \n"
+ EFogDrawMode.USE_OPTIFINE_SETTING + ": Use whatever Fog setting Optifine is using.\n"
+ "If Optifine isn't installed this defaults to " + EFogDrawMode.FOG_ENABLED + ". \n"
+ EFogDrawMode.FOG_ENABLED + ": Never draw fog on the LODs \n"
+ EFogDrawMode.FOG_DISABLED + ": Always draw fast fog on the LODs \n"
+ "\n"
+ "Disabling fog will improve GPU performance.")
.build();
public static ConfigEntry<FogColorMode> fogColorMode = new ConfigEntry.Builder<FogColorMode>()
.set(FogColorMode.USE_WORLD_FOG_COLOR)
public static ConfigEntry<EFogColorMode> fogColorMode = new ConfigEntry.Builder<EFogColorMode>()
.set(EFogColorMode.USE_WORLD_FOG_COLOR)
.comment(""
+ "What color should fog use? \n"
+ "\n"
+ FogColorMode.USE_WORLD_FOG_COLOR + ": Use the world's fog color. \n"
+ FogColorMode.USE_SKY_COLOR + ": Use the sky's color. \n"
+ EFogColorMode.USE_WORLD_FOG_COLOR + ": Use the world's fog color. \n"
+ EFogColorMode.USE_SKY_COLOR + ": Use the sky's color. \n"
+ "\n"
+ "This setting doesn't affect performance.")
.build();
@@ -256,14 +256,14 @@ public class Config
+ " '1.0': Fully fog color.")
.build();
public static ConfigEntry<FogSetting.FogType> farFogType = new ConfigEntry.Builder<FogSetting.FogType>()
.set(FogSetting.FogType.EXPONENTIAL_SQUARED)
public static ConfigEntry<EFogSetting.FogType> farFogType = new ConfigEntry.Builder<EFogSetting.FogType>()
.set(EFogSetting.FogType.EXPONENTIAL_SQUARED)
.comment(""
+ "How the fog thickness should be calculated from distance? \n"
+ "\n"
+ FogSetting.FogType.LINEAR + ": Linear based on distance (will ignore 'density')\n"
+ FogSetting.FogType.EXPONENTIAL + ": 1/(e^(distance*density)) \n"
+ FogSetting.FogType.EXPONENTIAL_SQUARED + ": 1/(e^((distance*density)^2)")
+ EFogSetting.FogType.LINEAR + ": Linear based on distance (will ignore 'density')\n"
+ EFogSetting.FogType.EXPONENTIAL + ": 1/(e^(distance*density)) \n"
+ EFogSetting.FogType.EXPONENTIAL_SQUARED + ": 1/(e^((distance*density)^2)")
.build();
public static ConfigEntry<Double> farFogDensity = new ConfigEntry.Builder<Double>()
@@ -275,36 +275,36 @@ public class Config
public static class HeightFog {
public static ConfigEntry<HeightFogMixMode> heightFogMixMode = new ConfigEntry.Builder<HeightFogMixMode>()
.set(HeightFogMixMode.BASIC)
public static ConfigEntry<EHeightFogMixMode> heightFogMixMode = new ConfigEntry.Builder<EHeightFogMixMode>()
.set(EHeightFogMixMode.BASIC)
.comment(""
+ "How the height should effect the fog thickness combined with the normal function? \n"
+ "\n"
+ HeightFogMixMode.BASIC + ": No special height fog effect. Fog is calculated based on camera distance \n"
+ HeightFogMixMode.IGNORE_HEIGHT + ": Ignore height completely. Fog is calculated based on horizontal distance \n"
+ HeightFogMixMode.ADDITION + ": heightFog + farFog \n"
+ HeightFogMixMode.MAX + ": max(heightFog, farFog) \n"
+ HeightFogMixMode.MULTIPLY + ": heightFog * farFog \n"
+ HeightFogMixMode.INVERSE_MULTIPLY + ": 1 - (1-heightFog) * (1-farFog) \n"
+ HeightFogMixMode.LIMITED_ADDITION + ": farFog + max(farFog, heightFog) \n"
+ HeightFogMixMode.MULTIPLY_ADDITION + ": farFog + farFog * heightFog \n"
+ HeightFogMixMode.INVERSE_MULTIPLY_ADDITION + ": farFog + 1 - (1-heightFog) * (1-farFog) \n"
+ HeightFogMixMode.AVERAGE + ": farFog*0.5 + heightFog*0.5 \n"
+ EHeightFogMixMode.BASIC + ": No special height fog effect. Fog is calculated based on camera distance \n"
+ EHeightFogMixMode.IGNORE_HEIGHT + ": Ignore height completely. Fog is calculated based on horizontal distance \n"
+ EHeightFogMixMode.ADDITION + ": heightFog + farFog \n"
+ EHeightFogMixMode.MAX + ": max(heightFog, farFog) \n"
+ EHeightFogMixMode.MULTIPLY + ": heightFog * farFog \n"
+ EHeightFogMixMode.INVERSE_MULTIPLY + ": 1 - (1-heightFog) * (1-farFog) \n"
+ EHeightFogMixMode.LIMITED_ADDITION + ": farFog + max(farFog, heightFog) \n"
+ EHeightFogMixMode.MULTIPLY_ADDITION + ": farFog + farFog * heightFog \n"
+ EHeightFogMixMode.INVERSE_MULTIPLY_ADDITION + ": farFog + 1 - (1-heightFog) * (1-farFog) \n"
+ EHeightFogMixMode.AVERAGE + ": farFog*0.5 + heightFog*0.5 \n"
+ "\n"
+ "Note that for 'BASIC' mode and 'IGNORE_HEIGHT' mode, fog settings for height fog has no effect.")
.build();
public static ConfigEntry<HeightFogMode> heightFogMode = new ConfigEntry.Builder<HeightFogMode>()
.set(HeightFogMode.ABOVE_AND_BELOW_CAMERA)
public static ConfigEntry<EHeightFogMode> heightFogMode = new ConfigEntry.Builder<EHeightFogMode>()
.set(EHeightFogMode.ABOVE_AND_BELOW_CAMERA)
.comment(""
+ "Where should the height fog be located? \n"
+ "\n"
+ HeightFogMode.ABOVE_CAMERA + ": Height fog starts from camera to the sky \n"
+ HeightFogMode.BELOW_CAMERA + ": Height fog starts from camera to the void \n"
+ HeightFogMode.ABOVE_AND_BELOW_CAMERA + ": Height fog starts from camera to both the sky and the void \n"
+ HeightFogMode.ABOVE_SET_HEIGHT + ": Height fog starts from a set height to the sky \n"
+ HeightFogMode.BELOW_SET_HEIGHT + ": Height fog starts from a set height to the void \n"
+ HeightFogMode.ABOVE_AND_BELOW_SET_HEIGHT + ": Height fog starts from a set height to both the sky and the void")
+ EHeightFogMode.ABOVE_CAMERA + ": Height fog starts from camera to the sky \n"
+ EHeightFogMode.BELOW_CAMERA + ": Height fog starts from camera to the void \n"
+ EHeightFogMode.ABOVE_AND_BELOW_CAMERA + ": Height fog starts from camera to both the sky and the void \n"
+ EHeightFogMode.ABOVE_SET_HEIGHT + ": Height fog starts from a set height to the sky \n"
+ EHeightFogMode.BELOW_SET_HEIGHT + ": Height fog starts from a set height to the void \n"
+ EHeightFogMode.ABOVE_AND_BELOW_SET_HEIGHT + ": Height fog starts from a set height to both the sky and the void")
.build();
public static ConfigEntry<Double> heightFogHeight = new ConfigEntry.Builder<Double>()
@@ -348,14 +348,14 @@ public class Config
+ " '1.0': Fully fog color.")
.build();
public static ConfigEntry<FogSetting.FogType> heightFogType = new ConfigEntry.Builder<FogSetting.FogType>()
.set(FogSetting.FogType.EXPONENTIAL_SQUARED)
public static ConfigEntry<EFogSetting.FogType> heightFogType = new ConfigEntry.Builder<EFogSetting.FogType>()
.set(EFogSetting.FogType.EXPONENTIAL_SQUARED)
.comment(""
+ "How the fog thickness should be calculated from height? \n"
+ "\n"
+ FogSetting.FogType.LINEAR + ": Linear based on height (will ignore 'density')\n"
+ FogSetting.FogType.EXPONENTIAL + ": 1/(e^(height*density)) \n"
+ FogSetting.FogType.EXPONENTIAL_SQUARED + ": 1/(e^((height*density)^2)")
+ EFogSetting.FogType.LINEAR + ": Linear based on height (will ignore 'density')\n"
+ EFogSetting.FogType.EXPONENTIAL + ": 1/(e^(height*density)) \n"
+ EFogSetting.FogType.EXPONENTIAL_SQUARED + ": 1/(e^((height*density)^2)")
.build();
public static ConfigEntry<Double> heightFogDensity = new ConfigEntry.Builder<Double>()
@@ -382,19 +382,19 @@ public class Config
+ "Disable this if you see LODs disappearing at the corners of your vision.")
.build();
public static ConfigEntry<VanillaOverdraw> vanillaOverdraw = new ConfigEntry.Builder<VanillaOverdraw>()
.set(VanillaOverdraw.DYNAMIC)
public static ConfigEntry<EVanillaOverdraw> vanillaOverdraw = new ConfigEntry.Builder<EVanillaOverdraw>()
.set(EVanillaOverdraw.DYNAMIC)
.comment(""
+ "How often should LODs be drawn on top of regular chunks? \n"
+ "HALF and ALWAYS will prevent holes in the world, \n"
+ " but may look odd for transparent blocks or in caves. \n"
+ "\n"
+ VanillaOverdraw.NEVER + ": \n"
+ EVanillaOverdraw.NEVER + ": \n"
+ " LODs won't render on top of vanilla chunks. Use Overdraw offset to change the border offset. \n"
+ VanillaOverdraw.DYNAMIC + ": \n"
+ EVanillaOverdraw.DYNAMIC + ": \n"
+ " LODs will render on top of distant vanilla chunks to hide delayed loading. \n"
+ " Will dynamically decide the border offset based on vanilla render distance. \n"
+ VanillaOverdraw.ALWAYS + ": \n"
+ EVanillaOverdraw.ALWAYS + ": \n"
+ " LODs will render on all vanilla chunks preventing all holes in the world. \n"
+ "\n"
+ "This setting shouldn't affect performance.")
@@ -501,8 +501,8 @@ public class Config
+ "Note that in server, distant generation is always off.")
.build();
public static ConfigEntry<DistanceGenerationMode> distanceGenerationMode = new ConfigEntry.Builder<DistanceGenerationMode>()
.set(DistanceGenerationMode.FEATURES)
public static ConfigEntry<EDistanceGenerationMode> distanceGenerationMode = new ConfigEntry.Builder<EDistanceGenerationMode>()
.set(EDistanceGenerationMode.FEATURES)
.comment(""
+ "How detailed should fake chunks be generated outside the vanilla render distance? \n"
+ "\n"
@@ -512,34 +512,34 @@ public class Config
+ " may perform in comparison to each other. \n"
+ "(Note that all modes will load in already existing chunks) \n"
+ "\n"
+ DistanceGenerationMode.NONE + " \n"
+ EDistanceGenerationMode.NONE + " \n"
+ "Only run the Generator to load in already existing chunks. \n"
+ "\n"
+ DistanceGenerationMode.BIOME_ONLY + " \n"
+ EDistanceGenerationMode.BIOME_ONLY + " \n"
+ "Only generate the biomes and use the biome's \n"
+ " grass color, water color, or snow color. \n"
+ "Doesn't generate height, everything is shown at sea level. \n"
+ " - Fastest (2-5 ms) \n"
+ "\n"
+ DistanceGenerationMode.BIOME_ONLY_SIMULATE_HEIGHT + " \n"
+ "Same as " + DistanceGenerationMode.BIOME_ONLY + ", except instead \n"
+ EDistanceGenerationMode.BIOME_ONLY_SIMULATE_HEIGHT + " \n"
+ "Same as " + EDistanceGenerationMode.BIOME_ONLY + ", except instead \n"
+ " of always using sea level as the LOD height \n"
+ " different biome types (mountain, ocean, forest, etc.) \n"
+ " use predetermined heights to simulate having height data. \n"
+ " - Fastest (2-5 ms) \n"
+ "\n"
+ DistanceGenerationMode.SURFACE + " \n"
+ EDistanceGenerationMode.SURFACE + " \n"
+ "Generate the world surface, \n"
+ " this does NOT include trees, \n"
+ " or structures. \n"
+ " - Faster (10-20 ms) \n"
+ "\n"
+ DistanceGenerationMode.FEATURES + " \n"
+ EDistanceGenerationMode.FEATURES + " \n"
+ "Generate everything except structures. \n"
+ "WARNING: This may cause world generation bugs or instability! \n"
+ " - Fast (15-20 ms) \n"
+ "\n"
+ DistanceGenerationMode.FULL + " \n"
+ EDistanceGenerationMode.FULL + " \n"
+ "Ask the local server to generate/load each chunk. \n"
+ "This will show player made structures, which can \n"
+ " be useful if you are adding the mod to a pre-existing world. \n"
@@ -550,61 +550,61 @@ public class Config
+ " depending on how many world generation threads you have allocated.")
.build();
public static ConfigEntry<LightGenerationMode> lightGenerationMode = new ConfigEntry.Builder<LightGenerationMode>()
.set(LightGenerationMode.FANCY)
public static ConfigEntry<ELightGenerationMode> lightGenerationMode = new ConfigEntry.Builder<ELightGenerationMode>()
.set(ELightGenerationMode.FANCY)
.comment(""
+ "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"
+ ELightGenerationMode.FAST + ": Use height map to fake the light values. \n"
+ ELightGenerationMode.FANCY + ": Use actaul light engines to generate proper values. \n"
+ "\n"
+ "This will effect generation speed, but not the rendering performance.")
.build();
public static ConfigEntry<GenerationPriority> generationPriority = new ConfigEntry.Builder<GenerationPriority>()
.set(GenerationPriority.NEAR_FIRST)
public static ConfigEntry<EGenerationPriority> generationPriority = new ConfigEntry.Builder<EGenerationPriority>()
.set(EGenerationPriority.NEAR_FIRST)
.comment(""
+ "In what priority should fake chunks be generated outside the vanilla render distance? \n"
+ "\n"
+ GenerationPriority.FAR_FIRST + " \n"
+ EGenerationPriority.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"
+ EGenerationPriority.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"
+ EGenerationPriority.BALANCED + " \n"
+ "A mix between "+ EGenerationPriority.NEAR_FIRST+"and"+ EGenerationPriority.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"
+ EGenerationPriority.AUTO + " \n"
+ "Uses " + EGenerationPriority.BALANCED + " when on a single player world \n"
+ " and " + EGenerationPriority.NEAR_FIRST + " when connected to a server. \n"
+ "\n"
+ "This shouldn't affect performance.")
.build();
public static ConfigEntry<BlocksToAvoid> blocksToAvoid = new ConfigEntry.Builder<BlocksToAvoid>()
.set(BlocksToAvoid.BOTH)
public static ConfigEntry<EBlocksToAvoid> blocksToAvoid = new ConfigEntry.Builder<EBlocksToAvoid>()
.set(EBlocksToAvoid.BOTH)
.comment(""
+ "When generating fake chunks, what blocks should be ignored? \n"
+ "Ignored blocks don't affect the height of the fake chunk, but might affect the color. \n"
+ "So using " + BlocksToAvoid.BOTH + " will prevent snow covered blocks from appearing one block too tall, \n"
+ "So using " + EBlocksToAvoid.BOTH + " will prevent snow covered blocks from appearing one block too tall, \n"
+ " but will still show the snow's color.\n"
+ "\n"
+ BlocksToAvoid.NONE + ": Use all blocks when generating fake chunks \n"
+ BlocksToAvoid.NON_FULL + ": Only use full blocks when generating fake chunks (ignores slabs, lanterns, torches, tall grass, etc.) \n"
+ BlocksToAvoid.NO_COLLISION + ": Only use solid blocks when generating fake chunks (ignores tall grass, torches, etc.) \n"
+ BlocksToAvoid.BOTH + ": Only use full solid blocks when generating fake chunks \n"
+ EBlocksToAvoid.NONE + ": Use all blocks when generating fake chunks \n"
+ EBlocksToAvoid.NON_FULL + ": Only use full blocks when generating fake chunks (ignores slabs, lanterns, torches, tall grass, etc.) \n"
+ EBlocksToAvoid.NO_COLLISION + ": Only use solid blocks when generating fake chunks (ignores tall grass, torches, etc.) \n"
+ EBlocksToAvoid.BOTH + ": Only use full solid blocks when generating fake chunks \n"
+ "\n"
+ "This wont't affect performance.")
.build();
@@ -621,15 +621,15 @@ public class Config
public static class Multiplayer
{
public static ConfigEntry<ServerFolderNameMode> serverFolderNameMode = new ConfigEntry.Builder<ServerFolderNameMode>()
.set(ServerFolderNameMode.AUTO)
public static ConfigEntry<EServerFolderNameMode> serverFolderNameMode = new ConfigEntry.Builder<EServerFolderNameMode>()
.set(EServerFolderNameMode.AUTO)
.comment(""
+ " What multiplayer save folders should be named. \n"
+ "\n"
+ " " + ServerFolderNameMode.AUTO + ": " + ServerFolderNameMode.NAME_IP + " for LAN connections, " + ServerFolderNameMode.NAME_IP_PORT + " for all others. \n"
+ " " + ServerFolderNameMode.NAME_ONLY + ": Example: \"Minecraft Server\" \n"
+ " " + ServerFolderNameMode.NAME_IP + ": Example: \"Minecraft Server IP 192.168.1.40\" \n"
+ " " + ServerFolderNameMode.NAME_IP_PORT + ": Example: \"Minecraft Server IP 192.168.1.40:25565\"")
+ " " + EServerFolderNameMode.AUTO + ": " + EServerFolderNameMode.NAME_IP + " for LAN connections, " + EServerFolderNameMode.NAME_IP_PORT + " for all others. \n"
+ " " + EServerFolderNameMode.NAME_ONLY + ": Example: \"Minecraft Server\" \n"
+ " " + EServerFolderNameMode.NAME_IP + ": Example: \"Minecraft Server IP 192.168.1.40\" \n"
+ " " + EServerFolderNameMode.NAME_IP_PORT + ": Example: \"Minecraft Server IP 192.168.1.40:25565\"")
.build();
public static ConfigEntry<Double> multiDimensionRequiredSimilarity = new ConfigEntry.Builder<Double>()
@@ -730,29 +730,29 @@ public class Config
public static class Debugging
{
public static ConfigEntry<RendererType> rendererType = new ConfigEntry.Builder<RendererType>()
.set(RendererType.DEFAULT)
public static ConfigEntry<ERendererType> rendererType = new ConfigEntry.Builder<ERendererType>()
.set(ERendererType.DEFAULT)
.comment(""
+ "What renderer is active? \n"
+ "\n"
+ RendererType.DEFAULT + ": Default lod renderer \n"
+ RendererType.DEBUG + ": Debug testing renderer \n"
+ RendererType.DISABLED + ": Disable rendering")
+ ERendererType.DEFAULT + ": Default lod renderer \n"
+ ERendererType.DEBUG + ": Debug testing renderer \n"
+ ERendererType.DISABLED + ": Disable rendering")
.build();
public static ConfigEntry<DebugMode> debugMode = new ConfigEntry.Builder<DebugMode>()
.set(DebugMode.OFF)
public static ConfigEntry<EDebugMode> debugMode = new ConfigEntry.Builder<EDebugMode>()
.set(EDebugMode.OFF)
.comment(""
+ "Should specialized colors/rendering modes be used? \n"
+ "\n"
+ DebugMode.OFF + ": Fake chunks will be drawn with their normal colors. \n"
+ DebugMode.SHOW_WIREFRAME + ": Fake chunks will be drawn as wireframes. \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_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.SHOW_OVERLAPPING_QUADS + ": Fake chunks will be drawn with total white, but overlapping quads will be drawn with red. \n"
+ DebugMode.SHOW_OVERLAPPING_QUADS_WIREFRAME + ": Fake chunks will be drawn with total white, \n"
+ EDebugMode.OFF + ": Fake chunks will be drawn with their normal colors. \n"
+ EDebugMode.SHOW_WIREFRAME + ": Fake chunks will be drawn as wireframes. \n"
+ EDebugMode.SHOW_DETAIL + ": Fake chunks color will be based on their detail level. \n"
+ EDebugMode.SHOW_DETAIL_WIREFRAME + ": Fake chunks color will be based on their detail level, drawn as a wireframe. \n"
+ EDebugMode.SHOW_GENMODE + ": Fake chunks color will be based on their distant generation mode. \n"
+ EDebugMode.SHOW_GENMODE_WIREFRAME + ": Fake chunks color will be based on their distant generation mode, drawn as a wireframe. \n"
+ EDebugMode.SHOW_OVERLAPPING_QUADS + ": Fake chunks will be drawn with total white, but overlapping quads will be drawn with red. \n"
+ EDebugMode.SHOW_OVERLAPPING_QUADS_WIREFRAME + ": Fake chunks will be drawn with total white, \n"
+ " but overlapping quads will be drawn with red, drawn as a wireframe.")
.build();
@@ -778,64 +778,64 @@ public class Config
* FileSubDimEvent
* NetworkEvent //NOT IMPL YET
*/
public static ConfigEntry<LoggerMode> logWorldGenEvent = new ConfigEntry.Builder<LoggerMode>()
.set(LoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE)
public static ConfigEntry<ELoggerMode> logWorldGenEvent = new ConfigEntry.Builder<ELoggerMode>()
.set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE)
.comment(""
+ "If enabled, the mod will log information about the world generation process. \n"
+ "This can be useful for debugging.")
.build();
public static ConfigEntry<LoggerMode> logWorldGenPerformance = new ConfigEntry.Builder<LoggerMode>()
.set(LoggerMode.LOG_WARNING_TO_CHAT_AND_FILE)
public static ConfigEntry<ELoggerMode> logWorldGenPerformance = new ConfigEntry.Builder<ELoggerMode>()
.set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_FILE)
.comment(""
+ "If enabled, the mod will log performance about the world generation process. \n"
+ "This can be useful for debugging.")
.build();
public static ConfigEntry<LoggerMode> logWorldGenLoadEvent = new ConfigEntry.Builder<LoggerMode>()
.set(LoggerMode.LOG_WARNING_TO_CHAT_AND_FILE)
public static ConfigEntry<ELoggerMode> logWorldGenLoadEvent = new ConfigEntry.Builder<ELoggerMode>()
.set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_FILE)
.comment(""
+ "If enabled, the mod will log information about the world generation process. \n"
+ "This can be useful for debugging.")
.build();
public static ConfigEntry<LoggerMode> logLodBuilderEvent = new ConfigEntry.Builder<LoggerMode>()
.set(LoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE)
public static ConfigEntry<ELoggerMode> logLodBuilderEvent = new ConfigEntry.Builder<ELoggerMode>()
.set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE)
.comment(""
+ "If enabled, the mod will log information about the LOD generation process. \n"
+ "This can be useful for debugging.")
.build();
public static ConfigEntry<LoggerMode> logRendererBufferEvent = new ConfigEntry.Builder<LoggerMode>()
.set(LoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE)
public static ConfigEntry<ELoggerMode> logRendererBufferEvent = new ConfigEntry.Builder<ELoggerMode>()
.set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE)
.comment(""
+ "If enabled, the mod will log information about the renderer buffer process. \n"
+ "This can be useful for debugging.")
.build();
public static ConfigEntry<LoggerMode> logRendererGLEvent = new ConfigEntry.Builder<LoggerMode>()
.set(LoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE)
public static ConfigEntry<ELoggerMode> logRendererGLEvent = new ConfigEntry.Builder<ELoggerMode>()
.set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE)
.comment(""
+ "If enabled, the mod will log information about the renderer OpenGL process. \n"
+ "This can be useful for debugging.")
.build();
public static ConfigEntry<LoggerMode> logFileReadWriteEvent = new ConfigEntry.Builder<LoggerMode>()
.set(LoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE)
public static ConfigEntry<ELoggerMode> logFileReadWriteEvent = new ConfigEntry.Builder<ELoggerMode>()
.set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE)
.comment(""
+ "If enabled, the mod will log information about file read/write operations. \n"
+ "This can be useful for debugging.")
.build();
public static ConfigEntry<LoggerMode> logFileSubDimEvent = new ConfigEntry.Builder<LoggerMode>()
.set(LoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE)
public static ConfigEntry<ELoggerMode> logFileSubDimEvent = new ConfigEntry.Builder<ELoggerMode>()
.set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE)
.comment(""
+ "If enabled, the mod will log information about file sub-dimension operations. \n"
+ "This can be useful for debugging.")
.build();
public static ConfigEntry<LoggerMode> logNetworkEvent = new ConfigEntry.Builder<LoggerMode>()
.set(LoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE)
public static ConfigEntry<ELoggerMode> logNetworkEvent = new ConfigEntry.Builder<ELoggerMode>()
.set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE)
.comment(""
+ "If enabled, the mod will log information about network operations. \n"
+ "This can be useful for debugging.")
@@ -846,22 +846,22 @@ public class Config
public static class Buffers
{
public static ConfigEntry<GpuUploadMethod> gpuUploadMethod = new ConfigEntry.Builder<GpuUploadMethod>()
.set(GpuUploadMethod.AUTO)
public static ConfigEntry<EGpuUploadMethod> gpuUploadMethod = new ConfigEntry.Builder<EGpuUploadMethod>()
.set(EGpuUploadMethod.AUTO)
.comment(""
+ "What method should be used to upload geometry to the GPU? \n"
+ "\n"
+ GpuUploadMethod.AUTO + ": Picks the best option based on the GPU you have. \n"
+ GpuUploadMethod.BUFFER_STORAGE + ": Default for NVIDIA if OpenGL 4.5 is supported. \n"
+ EGpuUploadMethod.AUTO + ": Picks the best option based on the GPU you have. \n"
+ EGpuUploadMethod.BUFFER_STORAGE + ": Default for NVIDIA if OpenGL 4.5 is supported. \n"
+ " Fast rendering, no stuttering. \n"
+ GpuUploadMethod.SUB_DATA + ": Backup option for NVIDIA. \n"
+ EGpuUploadMethod.SUB_DATA + ": Backup option for NVIDIA. \n"
+ " Fast rendering but may stutter when uploading. \n"
+ GpuUploadMethod.BUFFER_MAPPING + ": Slow rendering but won't stutter when uploading. Possibly the best option for integrated GPUs. \n"
+ EGpuUploadMethod.BUFFER_MAPPING + ": Slow rendering but won't stutter when uploading. Possibly the best option for integrated GPUs. \n"
+ " Default option for AMD/Intel. \n"
+ " May end up storing buffers in System memory. \n"
+ " Fast rendering if in GPU memory, slow if in system memory, \n"
+ " but won't stutter when uploading. \n"
+ GpuUploadMethod.DATA + ": Fast rendering but will stutter when uploading. \n"
+ EGpuUploadMethod.DATA + ": Fast rendering but will stutter when uploading. \n"
+ " Backup option for AMD/Intel. \n"
+ " Fast rendering but may stutter when uploading. \n"
+ "\n"
@@ -883,8 +883,8 @@ public class Config
+ " and determined the best method for your hardware first.")
.build();
public static ConfigEntry<BufferRebuildTimes> rebuildTimes = new ConfigEntry.Builder<BufferRebuildTimes>()
.set(BufferRebuildTimes.NORMAL)
public static ConfigEntry<EBufferRebuildTimes> rebuildTimes = new ConfigEntry.Builder<EBufferRebuildTimes>()
.set(EBufferRebuildTimes.NORMAL)
.comment(""
+ "How frequently should vertex buffers (geometry) be rebuilt and sent to the GPU? \n"
+ "Higher settings may cause stuttering, but will prevent holes in the world")
@@ -1,6 +1,6 @@
package com.seibel.lod.core.config.gui;
import com.seibel.lod.core.enums.config.GpuUploadMethod;
import com.seibel.lod.core.enums.config.EGpuUploadMethod;
import com.seibel.lod.core.render.GLProxy;
import com.seibel.lod.core.render.objects.GLState;
import com.seibel.lod.core.render.objects.GLVertexBuffer;
@@ -58,7 +58,7 @@ public class ConfigScreen extends AbstractScreen {
buffer.rewind();
GLVertexBuffer vbo = new GLVertexBuffer(false);
vbo.bind();
vbo.uploadBuffer(buffer, 4, GpuUploadMethod.DATA, vertices.length * Float.BYTES);
vbo.uploadBuffer(buffer, 4, EGpuUploadMethod.DATA, vertices.length * Float.BYTES);
return vbo;
}
@@ -34,4 +34,7 @@ public class CoreEnumAssembly
// This is done so they can be found via reflection.
private static final CoreRenderingEnumAssembly renderingAssembly = new CoreRenderingEnumAssembly();
private static final CoreConfigEnumAssembly configAssembly = new CoreConfigEnumAssembly();
/** All enums should have this prefix */
public static final String ENUM_PREFIX = "E";
}
@@ -41,46 +41,46 @@ import com.seibel.lod.core.objects.math.Vec3i;
* @author James Seibel
* @version 2021-11-13
*/
public enum LodDirection
public enum ELodDirection
{
DOWN(0, 1, -1, "down", LodDirection.AxisDirection.NEGATIVE, LodDirection.Axis.Y, new Vec3i(0, -1, 0)),
UP(1, 0, -1, "up", LodDirection.AxisDirection.POSITIVE, LodDirection.Axis.Y, new Vec3i(0, 1, 0)),
NORTH(2, 3, 2, "north", LodDirection.AxisDirection.NEGATIVE, LodDirection.Axis.Z, new Vec3i(0, 0, -1)),
SOUTH(3, 2, 0, "south", LodDirection.AxisDirection.POSITIVE, LodDirection.Axis.Z, new Vec3i(0, 0, 1)),
WEST(4, 5, 1, "west", LodDirection.AxisDirection.NEGATIVE, LodDirection.Axis.X, new Vec3i(-1, 0, 0)),
EAST(5, 4, 3, "east", LodDirection.AxisDirection.POSITIVE, LodDirection.Axis.X, new Vec3i(1, 0, 0));
public static final LodDirection[] DIRECTIONS = new LodDirection[] {
LodDirection.UP,
LodDirection.DOWN,
LodDirection.WEST,
LodDirection.EAST,
LodDirection.NORTH,
LodDirection.SOUTH };
DOWN(0, 1, -1, "down", ELodDirection.AxisDirection.NEGATIVE, ELodDirection.Axis.Y, new Vec3i(0, -1, 0)),
UP(1, 0, -1, "up", ELodDirection.AxisDirection.POSITIVE, ELodDirection.Axis.Y, new Vec3i(0, 1, 0)),
NORTH(2, 3, 2, "north", ELodDirection.AxisDirection.NEGATIVE, ELodDirection.Axis.Z, new Vec3i(0, 0, -1)),
SOUTH(3, 2, 0, "south", ELodDirection.AxisDirection.POSITIVE, ELodDirection.Axis.Z, new Vec3i(0, 0, 1)),
WEST(4, 5, 1, "west", ELodDirection.AxisDirection.NEGATIVE, ELodDirection.Axis.X, new Vec3i(-1, 0, 0)),
EAST(5, 4, 3, "east", ELodDirection.AxisDirection.POSITIVE, ELodDirection.Axis.X, new Vec3i(1, 0, 0));
public static final ELodDirection[] DIRECTIONS = new ELodDirection[] {
ELodDirection.UP,
ELodDirection.DOWN,
ELodDirection.WEST,
ELodDirection.EAST,
ELodDirection.NORTH,
ELodDirection.SOUTH };
public static final LodDirection[] OPPOSITE_DIRECTIONS = new LodDirection[] {
LodDirection.UP,
LodDirection.DOWN,
LodDirection.SOUTH,
LodDirection.NORTH,
LodDirection.EAST,
LodDirection.WEST };
public static final ELodDirection[] OPPOSITE_DIRECTIONS = new ELodDirection[] {
ELodDirection.UP,
ELodDirection.DOWN,
ELodDirection.SOUTH,
ELodDirection.NORTH,
ELodDirection.EAST,
ELodDirection.WEST };
/** North, South, East, West */
public static final LodDirection[] ADJ_DIRECTIONS = new LodDirection[] {
LodDirection.EAST,
LodDirection.WEST,
LodDirection.SOUTH,
LodDirection.NORTH };
public static final ELodDirection[] ADJ_DIRECTIONS = new ELodDirection[] {
ELodDirection.EAST,
ELodDirection.WEST,
ELodDirection.SOUTH,
ELodDirection.NORTH };
// private final int data3d;
// private final int oppositeIndex;
// private final int data2d;
private final String name;
private final LodDirection.Axis axis;
private final LodDirection.AxisDirection axisDirection;
private final ELodDirection.Axis axis;
private final ELodDirection.AxisDirection axisDirection;
private final Vec3i normal;
private static final LodDirection[] VALUES = values();
private static final ELodDirection[] VALUES = values();
private static final Map<String, LodDirection> BY_NAME = Arrays.stream(VALUES).collect(Collectors.toMap(LodDirection::getName, (p_199787_0_) ->
private static final Map<String, ELodDirection> BY_NAME = Arrays.stream(VALUES).collect(Collectors.toMap(ELodDirection::getName, (p_199787_0_) ->
{
return p_199787_0_;
}));
@@ -117,7 +117,7 @@ public enum LodDirection
LodDirection(int p_i46016_3_, int p_i46016_4_, int p_i46016_5_, String p_i46016_6_, LodDirection.AxisDirection p_i46016_7_, LodDirection.Axis p_i46016_8_, Vec3i p_i46016_9_)
ELodDirection(int p_i46016_3_, int p_i46016_4_, int p_i46016_5_, String p_i46016_6_, ELodDirection.AxisDirection p_i46016_7_, ELodDirection.Axis p_i46016_8_, Vec3i p_i46016_9_)
{
// this.data3d = p_i46016_3_;
// this.data2d = p_i46016_5_;
@@ -218,7 +218,7 @@ public enum LodDirection
// return this.data2d;
// }
public LodDirection.AxisDirection getAxisDirection()
public ELodDirection.AxisDirection getAxisDirection()
{
return this.axisDirection;
}
@@ -228,7 +228,7 @@ public enum LodDirection
// return from3DDataValue(this.oppositeIndex);
// }
public LodDirection getClockWise()
public ELodDirection getClockWise()
{
switch (this)
{
@@ -245,7 +245,7 @@ public enum LodDirection
}
}
public LodDirection getCounterClockWise()
public ELodDirection getCounterClockWise()
{
switch (this)
{
@@ -267,12 +267,12 @@ public enum LodDirection
return this.name;
}
public LodDirection.Axis getAxis()
public ELodDirection.Axis getAxis()
{
return this.axis;
}
public static LodDirection byName(String name)
public static ELodDirection byName(String name)
{
return name == null ? null : BY_NAME.get(name.toLowerCase(Locale.ROOT));
}
@@ -298,17 +298,17 @@ public enum LodDirection
// return from2DDataValue(MathHelper.floor(p_176733_0_ / 90.0D + 0.5D) & 3);
// }
public static LodDirection fromAxisAndDirection(LodDirection.Axis p_211699_0_, LodDirection.AxisDirection p_211699_1_)
public static ELodDirection fromAxisAndDirection(ELodDirection.Axis p_211699_0_, ELodDirection.AxisDirection p_211699_1_)
{
switch (p_211699_0_)
{
case X:
return p_211699_1_ == LodDirection.AxisDirection.POSITIVE ? EAST : WEST;
return p_211699_1_ == ELodDirection.AxisDirection.POSITIVE ? EAST : WEST;
case Y:
return p_211699_1_ == LodDirection.AxisDirection.POSITIVE ? UP : DOWN;
return p_211699_1_ == ELodDirection.AxisDirection.POSITIVE ? UP : DOWN;
case Z:
default:
return p_211699_1_ == LodDirection.AxisDirection.POSITIVE ? SOUTH : NORTH;
return p_211699_1_ == ELodDirection.AxisDirection.POSITIVE ? SOUTH : NORTH;
}
}
@@ -345,9 +345,9 @@ public enum LodDirection
// return lodDirection;
// }
public static LodDirection get(LodDirection.AxisDirection p_181076_0_, LodDirection.Axis p_181076_1_)
public static ELodDirection get(ELodDirection.AxisDirection p_181076_0_, ELodDirection.Axis p_181076_1_)
{
for (LodDirection lodDirection : VALUES)
for (ELodDirection lodDirection : VALUES)
{
if (lodDirection.getAxisDirection() == p_181076_0_ && lodDirection.getAxis() == p_181076_1_)
{
@@ -371,7 +371,7 @@ public enum LodDirection
// return this.normal.getX() * f1 + this.normal.getZ() * f2 > 0.0F;
// }
public enum Axis implements Predicate<LodDirection>
public enum Axis implements Predicate<ELodDirection>
{
X("x")
{
@@ -416,9 +416,9 @@ public enum LodDirection
}
};
private static final LodDirection.Axis[] VALUES = values();
private static final ELodDirection.Axis[] VALUES = values();
private static final Map<String, LodDirection.Axis> BY_NAME = Arrays.stream(VALUES).collect(Collectors.toMap(LodDirection.Axis::getName, (p_199785_0_) ->
private static final Map<String, ELodDirection.Axis> BY_NAME = Arrays.stream(VALUES).collect(Collectors.toMap(ELodDirection.Axis::getName, (p_199785_0_) ->
{
return p_199785_0_;
}));
@@ -429,7 +429,7 @@ public enum LodDirection
this.name = name;
}
public static LodDirection.Axis byName(String name)
public static ELodDirection.Axis byName(String name)
{
return BY_NAME.get(name.toLowerCase(Locale.ROOT));
}
@@ -461,7 +461,7 @@ public enum LodDirection
// }
@Override
public boolean test(LodDirection p_test_1_)
public boolean test(ELodDirection p_test_1_)
{
return p_test_1_ != null && p_test_1_.getAxis() == this;
}
@@ -510,7 +510,7 @@ public enum LodDirection
return this.name;
}
public LodDirection.AxisDirection opposite()
public ELodDirection.AxisDirection opposite()
{
return this == POSITIVE ? NEGATIVE : POSITIVE;
}
@@ -25,7 +25,7 @@ package com.seibel.lod.core.enums;
* @author James Seibel
* @version 11-12-2021
*/
public enum WorldType
public enum EWorldType
{
ServerWorld,
ClientWorld,
@@ -26,7 +26,7 @@ package com.seibel.lod.core.enums.config;
* @author Leonardo Amato
* @version 11-16-2021
*/
public enum BlocksToAvoid
public enum EBlocksToAvoid
{
NONE(false, false),
@@ -39,7 +39,7 @@ public enum BlocksToAvoid
public final boolean nonFull;
public final boolean noCollision;
BlocksToAvoid(boolean nonFull, boolean noCollision)
EBlocksToAvoid(boolean nonFull, boolean noCollision)
{
this.nonFull = nonFull;
this.noCollision = noCollision;
@@ -29,7 +29,7 @@ package com.seibel.lod.core.enums.config;
* @author Leonardo Amato
* @version 9-25-2021
*/
public enum BufferRebuildTimes
public enum EBufferRebuildTimes
{
CONSTANT(0, 0, 0, 1),
@@ -44,7 +44,7 @@ public enum BufferRebuildTimes
public final int chunkChangeTimeout;
public final int playerMoveDistance;
BufferRebuildTimes(int playerMoveTimeout, int renderedChunkTimeout, int chunkChangeTimeout, int playerMoveDistance)
EBufferRebuildTimes(int playerMoveTimeout, int renderedChunkTimeout, int chunkChangeTimeout, int playerMoveDistance)
{
this.playerMoveTimeout = playerMoveTimeout;
this.renderedChunkTimeout = renderedChunkTimeout;
@@ -33,7 +33,7 @@ package com.seibel.lod.core.enums.config;
* @author Leonardo Amato
* @version 8-7-2021
*/
public enum DistanceGenerationMode
public enum EDistanceGenerationMode
{
/**
* Don't generate anything except just load in already existing chunks
@@ -82,31 +82,31 @@ public enum DistanceGenerationMode
*/
FULL((byte) 6);
public static DistanceGenerationMode RENDERABLE = DistanceGenerationMode.BIOME_ONLY;
public static EDistanceGenerationMode RENDERABLE = EDistanceGenerationMode.BIOME_ONLY;
/**
* The higher the number the more complete the generation is.
*/
public final byte complexity;
DistanceGenerationMode(byte complexity)
EDistanceGenerationMode(byte complexity)
{
this.complexity = complexity;
}
// Note: return null if out of range
public static DistanceGenerationMode previous(DistanceGenerationMode mode) {
public static EDistanceGenerationMode previous(EDistanceGenerationMode mode) {
switch (mode) {
case FULL:
return DistanceGenerationMode.FEATURES;
return EDistanceGenerationMode.FEATURES;
case FEATURES:
return DistanceGenerationMode.SURFACE;
return EDistanceGenerationMode.SURFACE;
case SURFACE:
return DistanceGenerationMode.BIOME_ONLY_SIMULATE_HEIGHT;
return EDistanceGenerationMode.BIOME_ONLY_SIMULATE_HEIGHT;
case BIOME_ONLY_SIMULATE_HEIGHT:
return DistanceGenerationMode.BIOME_ONLY;
return EDistanceGenerationMode.BIOME_ONLY;
case BIOME_ONLY:
return DistanceGenerationMode.NONE;
return EDistanceGenerationMode.NONE;
case NONE:
default:
return null;
@@ -114,18 +114,18 @@ public enum DistanceGenerationMode
}
// Note: return null if out of range
public static DistanceGenerationMode next(DistanceGenerationMode mode) {
public static EDistanceGenerationMode next(EDistanceGenerationMode mode) {
switch (mode) {
case FEATURES:
return DistanceGenerationMode.FULL;
return EDistanceGenerationMode.FULL;
case SURFACE:
return DistanceGenerationMode.FEATURES;
return EDistanceGenerationMode.FEATURES;
case BIOME_ONLY_SIMULATE_HEIGHT:
return DistanceGenerationMode.SURFACE;
return EDistanceGenerationMode.SURFACE;
case BIOME_ONLY:
return DistanceGenerationMode.BIOME_ONLY_SIMULATE_HEIGHT;
return EDistanceGenerationMode.BIOME_ONLY_SIMULATE_HEIGHT;
case NONE:
return DistanceGenerationMode.BIOME_ONLY;
return EDistanceGenerationMode.BIOME_ONLY;
case FULL:
default:
return null;
@@ -30,7 +30,8 @@ package com.seibel.lod.core.enums.config;
* @author Tom Lee
* @version 7-1-2022
*/
public enum DropoffQuality {
public enum EDropoffQuality
{
/** SMOOTH_DROPOFF when <128 lod view distance, or PERFORMANCE_FOCUSED otherwise */
AUTO(-1),
@@ -41,7 +42,7 @@ public enum DropoffQuality {
public final int fastModeSwitch;
DropoffQuality(int fastModeSwitch) {
EDropoffQuality(int fastModeSwitch) {
this.fastModeSwitch = fastModeSwitch;
}
@@ -30,7 +30,7 @@ package com.seibel.lod.core.enums.config;
* @author Leonardo Amato
* @version 12-1-2021
*/
public enum GenerationPriority
public enum EGenerationPriority
{
/** NEAR_FIRST when connected to servers and BALANCED when on single player */
AUTO,
@@ -25,7 +25,7 @@ package com.seibel.lod.core.enums.config;
* @author James Seibel
* @version 12-1-2021
*/
public enum GpuUploadMethod
public enum EGpuUploadMethod
{
/** Picks the best option based on the GPU the user has. */
AUTO(false, false),
@@ -62,7 +62,7 @@ public enum GpuUploadMethod
public final boolean useEarlyMapping;
public final boolean useBufferStorage;
GpuUploadMethod(boolean useEarlyMapping, boolean useBufferStorage) {
EGpuUploadMethod(boolean useEarlyMapping, boolean useBufferStorage) {
this.useEarlyMapping = useEarlyMapping;
this.useBufferStorage = useBufferStorage;
}
@@ -30,7 +30,7 @@ package com.seibel.lod.core.enums.config;
* @author Leonardo Amato
* @version 9-29-2021
*/
public enum HorizontalQuality
public enum EHorizontalQuality
{
/** 1.0 AKA Linear */
LOWEST(1.0f),
@@ -46,7 +46,7 @@ public enum HorizontalQuality
public final double quadraticBase;
HorizontalQuality(double distanceUnit)
EHorizontalQuality(double distanceUnit)
{
this.quadraticBase = distanceUnit;
}
@@ -35,7 +35,7 @@ import com.seibel.lod.core.util.LodUtil;
* @author Leonardo Amato
* @version 9-25-2021
*/
public enum HorizontalResolution
public enum EHorizontalResolution
{
/** render 256 LODs for each chunk */
BLOCK(16, 0),
@@ -85,12 +85,12 @@ public enum HorizontalResolution
* 2nd dimension: An array of all LodDetails that are less than or <br>
* equal to that detailLevel
*/
private static HorizontalResolution[][] lowerDetailArrays;
private static EHorizontalResolution[][] lowerDetailArrays;
HorizontalResolution(int newLengthCount, int newDetailLevel)
EHorizontalResolution(int newLengthCount, int newDetailLevel)
{
detailLevel = (byte) newDetailLevel;
dataPointLengthCount = newLengthCount;
@@ -129,20 +129,20 @@ public enum HorizontalResolution
* Returns an array of all LodDetails that have a detail level
* that is less than or equal to the given LodDetail
*/
public static HorizontalResolution[] getSelfAndLowerDetails(HorizontalResolution detail)
public static EHorizontalResolution[] getSelfAndLowerDetails(EHorizontalResolution detail)
{
if (lowerDetailArrays == null)
{
// run first time setup
lowerDetailArrays = new HorizontalResolution[HorizontalResolution.values().length][];
lowerDetailArrays = new EHorizontalResolution[EHorizontalResolution.values().length][];
// go through each LodDetail
for (HorizontalResolution currentDetail : HorizontalResolution.values())
for (EHorizontalResolution currentDetail : EHorizontalResolution.values())
{
ArrayList<HorizontalResolution> lowerDetails = new ArrayList<>();
ArrayList<EHorizontalResolution> lowerDetails = new ArrayList<>();
// find the details lower than currentDetail
for (HorizontalResolution compareDetail : HorizontalResolution.values())
for (EHorizontalResolution compareDetail : EHorizontalResolution.values())
{
if (currentDetail.detailLevel <= compareDetail.detailLevel)
{
@@ -154,7 +154,7 @@ public enum HorizontalResolution
Collections.sort(lowerDetails);
Collections.reverse(lowerDetails);
lowerDetailArrays[currentDetail.detailLevel] = lowerDetails.toArray(new HorizontalResolution[lowerDetails.size()]);
lowerDetailArrays[currentDetail.detailLevel] = lowerDetails.toArray(new EHorizontalResolution[lowerDetails.size()]);
}
}
@@ -162,9 +162,9 @@ public enum HorizontalResolution
}
/** Returns what detail level should be used at a given distance and maxDistance. */
public static HorizontalResolution getDetailForDistance(HorizontalResolution maxDetailLevel, int distance, int maxDistance)
public static EHorizontalResolution getDetailForDistance(EHorizontalResolution maxDetailLevel, int distance, int maxDistance)
{
HorizontalResolution[] lowerDetails = getSelfAndLowerDetails(maxDetailLevel);
EHorizontalResolution[] lowerDetails = getSelfAndLowerDetails(maxDetailLevel);
int distanceBetweenDetails = maxDistance / lowerDetails.length;
int index = LodUtil.clamp(0, distance / distanceBetweenDetails, lowerDetails.length - 1);
@@ -29,7 +29,7 @@ package com.seibel.lod.core.enums.config;
* @author Leonardo Amato
* @version 9-25-2021
*/
public enum HorizontalScale
public enum EHorizontalScale
{
/** Lods are 2D with heightMap */
LOW(64),
@@ -42,7 +42,7 @@ public enum HorizontalScale
public final int distanceUnit;
HorizontalScale(int distanceUnit)
EHorizontalScale(int distanceUnit)
{
this.distanceUnit = distanceUnit;
}
@@ -19,7 +19,7 @@
package com.seibel.lod.core.enums.config;
public enum LightGenerationMode
public enum ELightGenerationMode
{
// Fake in light values based on height maps
@@ -20,7 +20,8 @@
package com.seibel.lod.core.enums.config;
import org.apache.logging.log4j.Level;
public enum LoggerMode {
public enum ELoggerMode
{
DISABLED(Level.OFF, Level.OFF),
LOG_ALL_TO_FILE(Level.ALL, Level.OFF),
LOG_ERROR_TO_CHAT(Level.ALL, Level.ERROR),
@@ -37,7 +38,7 @@ public enum LoggerMode {
;
public final Level levelForFile;
public final Level levelForChat;
LoggerMode(Level levelForFile, Level levelForChat) {
ELoggerMode(Level levelForFile, Level levelForChat) {
this.levelForFile = levelForFile;
this.levelForChat = levelForChat;
}
@@ -31,7 +31,7 @@ package com.seibel.lod.core.enums.config;
* @author James Seibel
* @version 3-7-2022
*/
public enum ServerFolderNameMode
public enum EServerFolderNameMode
{
/**
* NAME_IP for LAN connections <Br>
@@ -25,7 +25,7 @@ package com.seibel.lod.core.enums.config;
* @author James Seibel
* @version 7-25-2020
*/
public enum ShadingMode
public enum EShadingMode
{
/**
* LODs will have darker sides and bottoms to simulate
@@ -29,7 +29,7 @@ package com.seibel.lod.core.enums.config;
* @author James Seibel
* @version 10-11-2021
*/
public enum VanillaOverdraw
public enum EVanillaOverdraw
{
/** Dont draw LODs where a minecraft chunk could be. Use Overdraw Offset to tweak the border thickness */
NEVER,
@@ -26,7 +26,7 @@ package com.seibel.lod.core.enums.config;
* @author Leonardo Amato
* @version 2022-3-26
*/
public enum VerticalQuality
public enum EVerticalQuality
{
LOW(
new int[] { 4, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1 },
@@ -53,23 +53,23 @@ public enum VerticalQuality
@Deprecated // Will find other ways to optimize
public final int maxConnectedLods;
VerticalQuality(int[] maxVerticalData, int maxConnectedLods)
EVerticalQuality(int[] maxVerticalData, int maxConnectedLods)
{
this.maxVerticalData = maxVerticalData;
this.maxConnectedLods = maxConnectedLods;
}
/** returns null if out of range */
public static VerticalQuality previous(VerticalQuality mode)
public static EVerticalQuality previous(EVerticalQuality mode)
{
switch (mode)
{
case ULTRA:
return VerticalQuality.HIGH;
return EVerticalQuality.HIGH;
case HIGH:
return VerticalQuality.MEDIUM;
return EVerticalQuality.MEDIUM;
case MEDIUM:
return VerticalQuality.LOW;
return EVerticalQuality.LOW;
case LOW:
default:
return null;
@@ -77,16 +77,16 @@ public enum VerticalQuality
}
/** returns null if out of range */
public static VerticalQuality next(VerticalQuality mode)
public static EVerticalQuality next(EVerticalQuality mode)
{
switch (mode)
{
case MEDIUM:
return VerticalQuality.HIGH;
return EVerticalQuality.HIGH;
case LOW:
return VerticalQuality.MEDIUM;
return EVerticalQuality.MEDIUM;
case HIGH:
return VerticalQuality.ULTRA;
return EVerticalQuality.ULTRA;
case ULTRA:
default:
return null;
@@ -98,18 +98,18 @@ public enum VerticalQuality
* Returns null if no enums match the name. <br>
* Similar to valueOf(String value)
*/
public static VerticalQuality getByName(String name)
public static EVerticalQuality getByName(String name)
{
switch (name.toUpperCase())
{
case "ULTRA":
return VerticalQuality.ULTRA;
return EVerticalQuality.ULTRA;
case "HIGH":
return VerticalQuality.HIGH;
return EVerticalQuality.HIGH;
case "MEDIUM":
return VerticalQuality.MEDIUM;
return EVerticalQuality.MEDIUM;
case "LOW":
return VerticalQuality.LOW;
return EVerticalQuality.LOW;
default:
return null;
@@ -25,7 +25,7 @@ package com.seibel.lod.core.enums.rendering;
* @author James Seibel
* @version 8-28-2021
*/
public enum DebugMode
public enum EDebugMode
{
/** LODs are rendered normally */
OFF,
@@ -54,12 +54,12 @@ public enum DebugMode
/** returns the next debug mode */
// Deprecated: use DebugMode.next() instead
@Deprecated
public DebugMode getNext()
public EDebugMode getNext()
{
return next(this);
}
public static DebugMode next(DebugMode type) {
public static EDebugMode next(EDebugMode type) {
switch (type) {
case OFF: return SHOW_WIREFRAME;
case SHOW_WIREFRAME: return SHOW_DETAIL;
@@ -72,7 +72,7 @@ public enum DebugMode
}
}
public static DebugMode previous(DebugMode type) {
public static EDebugMode previous(EDebugMode type) {
switch (type) {
case OFF: return SHOW_OVERLAPPING_QUADS_WIREFRAME;
case SHOW_OVERLAPPING_QUADS_WIREFRAME: return SHOW_OVERLAPPING_QUADS;
@@ -26,7 +26,7 @@ package com.seibel.lod.core.enums.rendering;
* @author James Seibel
* @version 2022-6-9
*/
public enum FogColorMode
public enum EFogColorMode
{
// Reminder:
// when adding items: up the API minor version
@@ -25,7 +25,7 @@ package com.seibel.lod.core.enums.rendering;
* @author James Seibel
* @version 2022-6-2
*/
public enum FogDistance
public enum EFogDistance
{
// Reminder:
// when adding items up the API minor version
@@ -27,7 +27,7 @@ package com.seibel.lod.core.enums.rendering;
* @author James Seibel
* @version 2022-6-2
*/
public enum FogDrawMode
public enum EFogDrawMode
{
// Reminder:
// when adding items up the API minor version
@@ -26,10 +26,10 @@ import java.util.Objects;
*
* @version 2022-4-13
*/
public class FogSetting
public class EFogSetting
{
/** a FogSetting object with 0 for every value */
public static final FogSetting EMPTY = new FogSetting(0, 0, 0, 0,0, FogSetting.FogType.LINEAR);
public static final EFogSetting EMPTY = new EFogSetting(0, 0, 0, 0,0, EFogSetting.FogType.LINEAR);
public final double start;
@@ -39,7 +39,7 @@ public class FogSetting
public final double density;
public final FogType fogType;
public FogSetting(double start, double end, double min, double max, double density, FogType fogType)
public EFogSetting(double start, double end, double min, double max, double density, FogType fogType)
{
this.start = start;
this.end = end;
@@ -56,7 +56,7 @@ public class FogSetting
return true;
if (o == null || getClass() != o.getClass())
return false;
FogSetting that = (FogSetting) o;
EFogSetting that = (EFogSetting) o;
return Double.compare(that.start, start) == 0 && Double.compare(that.end, end) == 0 && Double.compare(that.min, min) == 0 && Double.compare(that.max, max) == 0 && Double.compare(that.density, density) == 0 && fogType == that.fogType;
}
@@ -25,7 +25,7 @@ package com.seibel.lod.core.enums.rendering;
* @author James Seibel
* @version 10-1-2021
*/
public enum GLProxyContext
public enum EGLProxyContext
{
/** Minecraft's render thread */
MINECRAFT,
@@ -34,7 +34,7 @@ package com.seibel.lod.core.enums.rendering;
* @author Leetom
* @version 2022-4-14
*/
public enum HeightFogMixMode
public enum EHeightFogMixMode
{
BASIC,
IGNORE_HEIGHT,
@@ -19,7 +19,7 @@
package com.seibel.lod.core.enums.rendering;
public enum HeightFogMode
public enum EHeightFogMode
{
ABOVE_CAMERA(true, true, false),
BELOW_CAMERA(true, false, true),
@@ -32,7 +32,7 @@ public enum HeightFogMode
public final boolean above;
public final boolean below;
HeightFogMode(boolean basedOnCamera, boolean above, boolean below)
EHeightFogMode(boolean basedOnCamera, boolean above, boolean below)
{
this.basedOnCamera = basedOnCamera;
this.above = above;
@@ -26,7 +26,7 @@ package com.seibel.lod.core.enums.rendering;
*
* @version 2022-6-2
*/
public enum RendererType
public enum ERendererType
{
// Reminder:
// when adding items up the API minor version
@@ -38,7 +38,7 @@ public enum RendererType
/** Used by the config GUI to cycle through the available rendering options */
public static RendererType next(RendererType type)
public static ERendererType next(ERendererType type)
{
switch (type)
{
@@ -49,7 +49,7 @@ public enum RendererType
}
/** Used by the config GUI to cycle through the available rendering options */
public static RendererType previous(RendererType type)
public static ERendererType previous(ERendererType type)
{
switch (type)
{
@@ -19,7 +19,7 @@
package com.seibel.lod.core.handlers;
import com.seibel.lod.core.enums.rendering.FogDrawMode;
import com.seibel.lod.core.enums.rendering.EFogDrawMode;
import com.seibel.lod.core.handlers.dependencyInjection.IBindable;
/**
@@ -40,7 +40,7 @@ import com.seibel.lod.core.handlers.dependencyInjection.IBindable;
public interface IReflectionHandler extends IBindable
{
/** @return Whether Optifine is set to render fog or not. */
FogDrawMode getFogDrawMode();
EFogDrawMode getFogDrawMode();
/** @return if Vivecraft is present. Attempts to find the "VRRenderer" class. */
boolean vivecraftPresent();
@@ -40,8 +40,8 @@ import com.seibel.lod.core.api.internal.ClientApi;
import org.apache.commons.compress.compressors.xz.XZCompressorInputStream;
import org.apache.commons.compress.compressors.xz.XZCompressorOutputStream;
import com.seibel.lod.core.enums.config.DistanceGenerationMode;
import com.seibel.lod.core.enums.config.VerticalQuality;
import com.seibel.lod.core.enums.config.EDistanceGenerationMode;
import com.seibel.lod.core.enums.config.EVerticalQuality;
import com.seibel.lod.core.objects.lod.LevelContainer;
import com.seibel.lod.core.objects.lod.LodDimension;
import com.seibel.lod.core.objects.lod.LodRegion;
@@ -145,9 +145,9 @@ public class LodDimensionFileHandler
if (!vertQualFile.isDirectory())
continue;
if (vertQualFile.getName().equals(VerticalQuality.HIGH.toString()) ||
vertQualFile.getName().equals(VerticalQuality.MEDIUM.toString()) ||
vertQualFile.getName().equals(VerticalQuality.LOW.toString()))
if (vertQualFile.getName().equals(EVerticalQuality.HIGH.toString()) ||
vertQualFile.getName().equals(EVerticalQuality.MEDIUM.toString()) ||
vertQualFile.getName().equals(EVerticalQuality.LOW.toString()))
{
File[] subFiles = vertQualFile.listFiles();
for (File subFile : subFiles)
@@ -155,12 +155,12 @@ public class LodDimensionFileHandler
if (!subFile.isDirectory())
continue;
if (subFile.getName().equals(DistanceGenerationMode.FULL.toString()) ||
subFile.getName().equals(DistanceGenerationMode.FEATURES.toString()) ||
subFile.getName().equals(DistanceGenerationMode.SURFACE.toString()) ||
subFile.getName().equals(DistanceGenerationMode.BIOME_ONLY_SIMULATE_HEIGHT.toString()) ||
subFile.getName().equals(DistanceGenerationMode.BIOME_ONLY.toString()) ||
subFile.getName().equals(DistanceGenerationMode.NONE.toString()))
if (subFile.getName().equals(EDistanceGenerationMode.FULL.toString()) ||
subFile.getName().equals(EDistanceGenerationMode.FEATURES.toString()) ||
subFile.getName().equals(EDistanceGenerationMode.SURFACE.toString()) ||
subFile.getName().equals(EDistanceGenerationMode.BIOME_ONLY_SIMULATE_HEIGHT.toString()) ||
subFile.getName().equals(EDistanceGenerationMode.BIOME_ONLY.toString()) ||
subFile.getName().equals(EDistanceGenerationMode.NONE.toString()))
{
LOGGER.info("Noticed old save structure files. Starting merge process...");
LodDimensionOldFileStructureHandler oldFileStructHandler = new LodDimensionOldFileStructureHandler(this);
@@ -168,11 +168,11 @@ public class LodDimensionFileHandler
{
// I got the lock to merge file.
LOGGER.info("Updating VerticalQuality LOW...");
oldFileStructHandler.mergeOldFileStructureForVertQuality(VerticalQuality.LOW);
oldFileStructHandler.mergeOldFileStructureForVertQuality(EVerticalQuality.LOW);
LOGGER.info("Updating VerticalQuality MEDIUM...");
oldFileStructHandler.mergeOldFileStructureForVertQuality(VerticalQuality.MEDIUM);
oldFileStructHandler.mergeOldFileStructureForVertQuality(EVerticalQuality.MEDIUM);
LOGGER.info("Updating VerticalQuality HIGH...");
oldFileStructHandler.mergeOldFileStructureForVertQuality(VerticalQuality.HIGH);
oldFileStructHandler.mergeOldFileStructureForVertQuality(EVerticalQuality.HIGH);
LOGGER.info("Update completed.");
}
else
@@ -199,7 +199,7 @@ public class LodDimensionFileHandler
* Returns a new LodRegion at the given coordinates.
* Returns an empty region if the file doesn't exist.
*/
public LodRegion loadRegionFromFile(byte detailLevel, DHRegionPos regionPos, VerticalQuality verticalQuality)
public LodRegion loadRegionFromFile(byte detailLevel, DHRegionPos regionPos, EVerticalQuality verticalQuality)
{
// Get one from the region hot cache
LodRegion region = regionToSave.get(regionPos);
@@ -214,7 +214,7 @@ public class LodDimensionFileHandler
* Returns the LodRegion that is filled at the given coordinates.
* Returns an empty region if the file doesn't exist.
*/
public LodRegion loadRegionFromFile(byte detailLevel, LodRegion region, VerticalQuality verticalQuality)
public LodRegion loadRegionFromFile(byte detailLevel, LodRegion region, EVerticalQuality verticalQuality)
{
if (region.getVerticalQuality().compareTo(verticalQuality) < 0)
{
@@ -313,7 +313,7 @@ public class LodDimensionFileHandler
// Save to File //
//==============//
public void saveDirect(int posX, int posZ, VerticalQuality vertQual, VerticalLevelContainer dataContainer)
public void saveDirect(int posX, int posZ, EVerticalQuality vertQual, VerticalLevelContainer dataContainer)
{
File file = new File(getFileBasePath() + vertQual + File.separatorChar +
DETAIL_FOLDER_NAME_PREFIX + dataContainer.detailLevel + File.separatorChar +
@@ -683,7 +683,7 @@ public class LodDimensionFileHandler
* <p>
* Returns null if there is an IO or security Exception.
*/
private File getRegionFile(int regionX, int regionZ, byte detail, VerticalQuality vertQuality)
private File getRegionFile(int regionX, int regionZ, byte detail, EVerticalQuality vertQuality)
{
return new File(getFileBasePath() + vertQuality + File.separatorChar +
DETAIL_FOLDER_NAME_PREFIX + detail + File.separatorChar +
@@ -691,7 +691,7 @@ public class LodDimensionFileHandler
}
/** Returns null if no file is found */
private File getBestMatchingRegionFile(byte detailLevel, int regionX, int regionZ, VerticalQuality targetVertQuality)
private File getBestMatchingRegionFile(byte detailLevel, int regionX, int regionZ, EVerticalQuality targetVertQuality)
{
// Search from least vertQuality to max vertQuality
do
@@ -700,7 +700,7 @@ public class LodDimensionFileHandler
if (file.exists())
return file; // Found target file.
targetVertQuality = VerticalQuality.next(targetVertQuality);
targetVertQuality = EVerticalQuality.next(targetVertQuality);
}
while (targetVertQuality != null);
@@ -26,8 +26,8 @@ import com.seibel.lod.core.handlers.dimensionFinder.PlayerData;
import com.seibel.lod.core.handlers.dimensionFinder.SubDimCompare;
import com.seibel.lod.core.builders.lodBuilding.LodBuilder;
import com.seibel.lod.core.builders.lodBuilding.LodBuilderConfig;
import com.seibel.lod.core.enums.config.DistanceGenerationMode;
import com.seibel.lod.core.enums.config.VerticalQuality;
import com.seibel.lod.core.enums.config.EDistanceGenerationMode;
import com.seibel.lod.core.enums.config.EVerticalQuality;
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
import com.seibel.lod.core.logging.ConfigBasedLogger;
import com.seibel.lod.core.objects.DHChunkPos;
@@ -66,7 +66,7 @@ public class LodDimensionFinder
() -> CONFIG.client().advanced().debugging().debugSwitch().getLogFileSubDimEvent());
/** Increasing this will increase accuracy but increase calculation time */
private static final VerticalQuality VERTICAL_QUALITY_TO_TEST_WITH = VerticalQuality.LOW;
private static final EVerticalQuality VERTICAL_QUALITY_TO_TEST_WITH = EVerticalQuality.LOW;
public static final String THREAD_NAME = "Sub-Dimension-Finder";
public static final String DEFAULT_SAVE_DIMENSION_FOLDER = "_Default-Sub-Dimension";
@@ -241,7 +241,7 @@ public class LodDimensionFinder
newlyLoadedDim.regions.set(playerRegionPos.x, playerRegionPos.z, new LodRegion(LodUtil.BLOCK_DETAIL_LEVEL, playerRegionPos, VERTICAL_QUALITY_TO_TEST_WITH));
// generate a LOD to test against
boolean lodGenerated = InternalApiShared.lodBuilder.generateLodNodeFromChunk(newlyLoadedDim, newlyLoadedChunk, new LodBuilderConfig(DistanceGenerationMode.FULL), true, true);
boolean lodGenerated = InternalApiShared.lodBuilder.generateLodNodeFromChunk(newlyLoadedDim, newlyLoadedChunk, new LodBuilderConfig(EDistanceGenerationMode.FULL), true, true);
if (!lodGenerated)
return null;
@@ -498,7 +498,7 @@ public class LodDimensionFinder
// check if there is at least one VerticalQuality folder in this directory
for (File internalFolder : potentialFolder.listFiles())
{
if (VerticalQuality.getByName(internalFolder.getName()) != null)
if (EVerticalQuality.getByName(internalFolder.getName()) != null)
{
// one of the internal folders is a VerticalQuality folder
return true;
@@ -522,7 +522,7 @@ public class LodDimensionFinder
for (File folder : dimensionFolder.listFiles())
{
if (VerticalQuality.getByName(folder.getName()) != null)
if (EVerticalQuality.getByName(folder.getName()) != null)
{
// this is a LOD save folder
// create a new sub dimension and move the data into it
@@ -33,7 +33,7 @@ import java.util.concurrent.Future;
import com.seibel.lod.core.logging.DhLoggerBuilder;
import org.apache.commons.compress.compressors.xz.XZCompressorInputStream;
import com.seibel.lod.core.enums.config.VerticalQuality;
import com.seibel.lod.core.enums.config.EVerticalQuality;
import com.seibel.lod.core.objects.DHRegionPos;
import com.seibel.lod.core.objects.lod.VerticalLevelContainer;
import com.seibel.lod.core.util.LodUtil;
@@ -72,10 +72,10 @@ public class LodDimensionOldFileStructureHandler
private static class TempLodRegion {
final VerticalLevelContainer[] containers;
final VerticalQuality vertQual;
final EVerticalQuality vertQual;
final int posX;
final int posZ;
TempLodRegion(VerticalQuality vertQual, DHRegionPos pos) {
TempLodRegion(EVerticalQuality vertQual, DHRegionPos pos) {
this.vertQual = vertQual;
posX = pos.x;
posZ = pos.z;
@@ -165,7 +165,7 @@ public class LodDimensionOldFileStructureHandler
}
}
private void loadAndMergeAndSaveRegion(VerticalQuality verticalQuality, DHRegionPos regionPos)
private void loadAndMergeAndSaveRegion(EVerticalQuality verticalQuality, DHRegionPos regionPos)
{
LOGGER.info("Merging region "+regionPos+" at "+verticalQuality+"...");
TempLodRegion region = new TempLodRegion(verticalQuality, regionPos);
@@ -195,7 +195,7 @@ public class LodDimensionOldFileStructureHandler
}
}
private HashSet<DHRegionPos> scanOldRegionFiles(VerticalQuality vertQual, OldDistanceGenerationMode genMode) {
private HashSet<DHRegionPos> scanOldRegionFiles(EVerticalQuality vertQual, OldDistanceGenerationMode genMode) {
HashSet<DHRegionPos> result = new HashSet<DHRegionPos>();
File baseBaseFolder = new File(getFileBasePath() + vertQual + File.separatorChar + genMode);
if (!baseBaseFolder.exists()) return result;
@@ -215,13 +215,13 @@ public class LodDimensionOldFileStructureHandler
return result;
}
private void renameOldFileStructure(VerticalQuality vertQual, OldDistanceGenerationMode genMode) {
private void renameOldFileStructure(EVerticalQuality 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));
}
public void mergeOldFileStructureForVertQuality(VerticalQuality vertQual) {
public void mergeOldFileStructureForVertQuality(EVerticalQuality vertQual) {
File baseFile = new File(getFileBasePath() + vertQual);
if (!baseFile.exists()) return;
if (!baseFile.isDirectory()) return;
@@ -27,7 +27,7 @@ import com.seibel.lod.core.logging.DhLoggerBuilder;
import com.seibel.lod.core.wrapperInterfaces.minecraft.IMinecraftClientWrapper;
import org.apache.logging.log4j.Logger;
import com.seibel.lod.core.enums.rendering.FogDrawMode;
import com.seibel.lod.core.enums.rendering.EFogDrawMode;
/**
* A singleton used to get variables from methods
@@ -109,14 +109,14 @@ public class ReflectionHandler implements IReflectionHandler
* @return the fog quality
*/
@Override
public FogDrawMode getFogDrawMode()
public EFogDrawMode getFogDrawMode()
{
if (ofFogField == null)
{
// either optifine isn't installed,
// the variable name was changed, or
// the setup method wasn't called yet.
return FogDrawMode.FOG_ENABLED;
return EFogDrawMode.FOG_ENABLED;
}
int returnNum = 0;
@@ -140,9 +140,9 @@ public class ReflectionHandler implements IReflectionHandler
// normal options
case 1: // fast
case 2: // fancy
return FogDrawMode.FOG_ENABLED;
return EFogDrawMode.FOG_ENABLED;
case 3: // off
return FogDrawMode.FOG_DISABLED;
return EFogDrawMode.FOG_DISABLED;
}
}
@@ -20,13 +20,12 @@
package com.seibel.lod.core.logging;
import com.seibel.lod.core.api.internal.ClientApi;
import com.seibel.lod.core.enums.config.LoggerMode;
import com.seibel.lod.core.enums.config.ELoggerMode;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.message.Message;
import java.lang.ref.WeakReference;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
@@ -43,10 +42,10 @@ public class ConfigBasedLogger {
});
}
private LoggerMode mode;
private final Supplier<LoggerMode> getter;
private ELoggerMode mode;
private final Supplier<ELoggerMode> getter;
private final Logger logger;
public ConfigBasedLogger(Logger logger, Supplier<LoggerMode> configQuery) {
public ConfigBasedLogger(Logger logger, Supplier<ELoggerMode> configQuery) {
getter = configQuery;
mode = getter.get();
this.logger = logger;
@@ -70,7 +69,7 @@ public class ConfigBasedLogger {
public void update() {
mode = getter.get();
}
public boolean canMaybeLog() {return mode != LoggerMode.DISABLED;}
public boolean canMaybeLog() {return mode != ELoggerMode.DISABLED;}
public void log(Level level, String str, Object... param) {
@@ -20,13 +20,12 @@
package com.seibel.lod.core.logging;
import com.seibel.lod.core.api.internal.ClientApi;
import com.seibel.lod.core.enums.config.LoggerMode;
import com.seibel.lod.core.enums.config.ELoggerMode;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.message.Message;
import java.lang.ref.WeakReference;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
@@ -45,13 +44,13 @@ public class ConfigBasedSpamLogger {
});
}
private LoggerMode mode;
private final Supplier<LoggerMode> getter;
private ELoggerMode mode;
private final Supplier<ELoggerMode> getter;
private final int maxLogCount;
private final AtomicInteger logTries = new AtomicInteger(0);
private final Logger logger;
public ConfigBasedSpamLogger(Logger logger, Supplier<LoggerMode> configQuery, int maxLogPerSec) {
public ConfigBasedSpamLogger(Logger logger, Supplier<ELoggerMode> configQuery, int maxLogPerSec) {
getter = configQuery;
mode = getter.get();
maxLogCount = maxLogPerSec;
@@ -59,7 +58,7 @@ public class ConfigBasedSpamLogger {
loggers.add(new WeakReference<>(this));
}
public void reset() {logTries.set(0);}
public boolean canMaybeLog() {return mode != LoggerMode.DISABLED && logTries.get() < maxLogCount;}
public boolean canMaybeLog() {return mode != ELoggerMode.DISABLED && logTries.get() < maxLogCount;}
public void update() {
mode = getter.get();
}
@@ -1,6 +1,6 @@
package com.seibel.lod.core.objects.a7.datatype.column;
import com.seibel.lod.core.enums.config.VerticalQuality;
import com.seibel.lod.core.enums.config.EVerticalQuality;
import com.seibel.lod.core.objects.a7.DHLevel;
import com.seibel.lod.core.objects.a7.data.*;
import com.seibel.lod.core.objects.a7.pos.DhSectionPos;
@@ -42,7 +42,7 @@ public class Alpha6DataLoader extends OldDataSourceLoader implements OldFileConv
private static DataFile convert(File file, int detailLevel, VerticalQuality quality) {
private static DataFile convert(File file, int detailLevel, EVerticalQuality quality) {
String oldName = file.getName();
String regionStr = oldName.substring("lod.".length(), oldName.length() - ".xz".length());
String[] parts = regionStr.split("\\.");
@@ -71,15 +71,15 @@ public class Alpha6DataLoader extends OldDataSourceLoader implements OldFileConv
List<DataFile> files = new ArrayList<>();
List<File> foldersToScan = new ArrayList<>(VerticalQuality.values().length);
for (VerticalQuality q : VerticalQuality.values()) {
List<File> foldersToScan = new ArrayList<>(EVerticalQuality.values().length);
for (EVerticalQuality q : EVerticalQuality.values()) {
File qualityFolder = new File(levelFolder, q.toString());
for (int i = 0; i < 10; i++) {
foldersToScan.add(new File(qualityFolder, "detail-"+i));
}
}
for (VerticalQuality q : VerticalQuality.values()) {
for (EVerticalQuality q : EVerticalQuality.values()) {
for (int i = 0; i < 10; i++) {
File detailFolder = new File(levelFolder, q.toString() + File.pathSeparator + "detail-" + i);
if (!detailFolder.exists() || !detailFolder.isDirectory()) continue;
@@ -20,9 +20,8 @@
package com.seibel.lod.core.objects.a7.datatype.column;
import com.seibel.lod.core.builders.lodBuilding.bufferBuilding.LodQuadBuilder;
import com.seibel.lod.core.enums.LodDirection;
import com.seibel.lod.core.enums.ELodDirection;
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
import com.seibel.lod.core.objects.LodDataView;
import com.seibel.lod.core.util.ColorUtil;
import com.seibel.lod.core.util.DataPointUtil;
import com.seibel.lod.core.wrapperInterfaces.minecraft.IMinecraftClientWrapper;
@@ -49,103 +48,103 @@ public class ColumnBox
// == 255;
if (!skipTop)
builder.addQuadUp(x, maxY, z, xSize, zSize, ColorUtil.applyShade(color, MC.getShade(LodDirection.UP)), skyLightTop, blockLight);
builder.addQuadUp(x, maxY, z, xSize, zSize, ColorUtil.applyShade(color, MC.getShade(ELodDirection.UP)), skyLightTop, blockLight);
if (!skipBot)
builder.addQuadDown(x, y, z, xSize, zSize, ColorUtil.applyShade(color, MC.getShade(LodDirection.DOWN)), skyLightBot, blockLight);
builder.addQuadDown(x, y, z, xSize, zSize, ColorUtil.applyShade(color, MC.getShade(ELodDirection.DOWN)), skyLightBot, blockLight);
//If the adj pos is at the same level we cull the faces normally, otherwise we divide the face in two and cull the two part separately
//NORTH face vertex creation
{
ColumnArrayView[] adjDataNorth = adjData[LodDirection.NORTH.ordinal() - 2];
ColumnArrayView[] adjDataNorth = adjData[ELodDirection.NORTH.ordinal() - 2];
int adjOverlapNorth = ColorUtil.TRANSPARENT;
if (adjDataNorth == null)
{
builder.addQuadAdj(LodDirection.NORTH, x, y, z, xSize, ySize, color, (byte) 15, blockLight);
builder.addQuadAdj(ELodDirection.NORTH, x, y, z, xSize, ySize, color, (byte) 15, blockLight);
}
else if (adjDataNorth.length == 1)
{
makeAdjQuads(builder, adjDataNorth[0], LodDirection.NORTH, x, y, z, xSize, ySize,
makeAdjQuads(builder, adjDataNorth[0], ELodDirection.NORTH, x, y, z, xSize, ySize,
color, adjOverlapNorth, skyLightTop, blockLight);
}
else
{
makeAdjQuads(builder, adjDataNorth[0], LodDirection.NORTH, x, y, z, (short) (xSize / 2), ySize,
makeAdjQuads(builder, adjDataNorth[0], ELodDirection.NORTH, x, y, z, (short) (xSize / 2), ySize,
color, adjOverlapNorth, skyLightTop, blockLight);
makeAdjQuads(builder, adjDataNorth[1], LodDirection.NORTH, (short) (x + xSize / 2), y, z, (short) (xSize / 2), ySize,
makeAdjQuads(builder, adjDataNorth[1], ELodDirection.NORTH, (short) (x + xSize / 2), y, z, (short) (xSize / 2), ySize,
color, adjOverlapNorth, skyLightTop, blockLight);
}
}
//SOUTH face vertex creation
{
ColumnArrayView[] adjDataSouth = adjData[LodDirection.SOUTH.ordinal() - 2];
ColumnArrayView[] adjDataSouth = adjData[ELodDirection.SOUTH.ordinal() - 2];
int adjOverlapSouth = ColorUtil.TRANSPARENT;
if (adjDataSouth == null)
{
builder.addQuadAdj(LodDirection.SOUTH, x, y, maxZ, xSize, ySize, color, (byte) 15, blockLight);
builder.addQuadAdj(ELodDirection.SOUTH, x, y, maxZ, xSize, ySize, color, (byte) 15, blockLight);
}
else if (adjDataSouth.length == 1)
{
makeAdjQuads(builder, adjDataSouth[0], LodDirection.SOUTH, x, y, maxZ, xSize, ySize,
makeAdjQuads(builder, adjDataSouth[0], ELodDirection.SOUTH, x, y, maxZ, xSize, ySize,
color, adjOverlapSouth, skyLightTop, blockLight);
}
else
{
makeAdjQuads(builder, adjDataSouth[0], LodDirection.SOUTH, x, y, maxZ, (short) (xSize / 2), ySize,
makeAdjQuads(builder, adjDataSouth[0], ELodDirection.SOUTH, x, y, maxZ, (short) (xSize / 2), ySize,
color, adjOverlapSouth, skyLightTop, blockLight);
makeAdjQuads(builder, adjDataSouth[1], LodDirection.SOUTH, (short) (x + xSize / 2), y, maxZ, (short) (xSize / 2), ySize,
makeAdjQuads(builder, adjDataSouth[1], ELodDirection.SOUTH, (short) (x + xSize / 2), y, maxZ, (short) (xSize / 2), ySize,
color, adjOverlapSouth, skyLightTop, blockLight);
}
}
//WEST face vertex creation
{
ColumnArrayView[] adjDataWest = adjData[LodDirection.WEST.ordinal() - 2];
ColumnArrayView[] adjDataWest = adjData[ELodDirection.WEST.ordinal() - 2];
int adjOverlapWest = ColorUtil.TRANSPARENT;
if (adjDataWest == null)
{
builder.addQuadAdj(LodDirection.WEST, x, y, z, zSize, ySize, color, (byte) 15, blockLight);
builder.addQuadAdj(ELodDirection.WEST, x, y, z, zSize, ySize, color, (byte) 15, blockLight);
}
else if (adjDataWest.length == 1)
{
makeAdjQuads(builder, adjDataWest[0], LodDirection.WEST, x, y, z, zSize, ySize,
makeAdjQuads(builder, adjDataWest[0], ELodDirection.WEST, x, y, z, zSize, ySize,
color, adjOverlapWest, skyLightTop, blockLight);
}
else
{
makeAdjQuads(builder, adjDataWest[0], LodDirection.WEST, x, y, z, (short) (zSize / 2), ySize,
makeAdjQuads(builder, adjDataWest[0], ELodDirection.WEST, x, y, z, (short) (zSize / 2), ySize,
color, adjOverlapWest, skyLightTop, blockLight);
makeAdjQuads(builder, adjDataWest[1], LodDirection.WEST, x, y, (short) (z + zSize / 2), (short) (zSize / 2), ySize,
makeAdjQuads(builder, adjDataWest[1], ELodDirection.WEST, x, y, (short) (z + zSize / 2), (short) (zSize / 2), ySize,
color, adjOverlapWest, skyLightTop, blockLight);
}
}
//EAST face vertex creation
{
ColumnArrayView[] adjDataEast = adjData[LodDirection.EAST.ordinal() - 2];
ColumnArrayView[] adjDataEast = adjData[ELodDirection.EAST.ordinal() - 2];
int adjOverlapEast = ColorUtil.TRANSPARENT;
if (adjData[LodDirection.EAST.ordinal() - 2] == null)
if (adjData[ELodDirection.EAST.ordinal() - 2] == null)
{
builder.addQuadAdj(LodDirection.EAST, maxX, y, z, zSize, ySize, color, (byte) 15, blockLight);
builder.addQuadAdj(ELodDirection.EAST, maxX, y, z, zSize, ySize, color, (byte) 15, blockLight);
}
else if (adjDataEast.length == 1)
{
makeAdjQuads(builder, adjDataEast[0], LodDirection.EAST, maxX, y, z, zSize, ySize,
makeAdjQuads(builder, adjDataEast[0], ELodDirection.EAST, maxX, y, z, zSize, ySize,
color, adjOverlapEast, skyLightTop, blockLight);
}
else
{
makeAdjQuads(builder, adjDataEast[0], LodDirection.EAST, maxX, y, z, (short) (zSize / 2), ySize,
makeAdjQuads(builder, adjDataEast[0], ELodDirection.EAST, maxX, y, z, (short) (zSize / 2), ySize,
color, adjOverlapEast, skyLightTop, blockLight);
makeAdjQuads(builder, adjDataEast[1], LodDirection.EAST, maxX, y, (short) (z + zSize / 2), (short) (zSize / 2), ySize,
makeAdjQuads(builder, adjDataEast[1], ELodDirection.EAST, maxX, y, (short) (z + zSize / 2), (short) (zSize / 2), ySize,
color, adjOverlapEast, skyLightTop, blockLight);
}
}
}
private static void makeAdjQuads(LodQuadBuilder builder, ColumnArrayView adjData, LodDirection direction, short x, short y,
private static void makeAdjQuads(LodQuadBuilder builder, ColumnArrayView adjData, ELodDirection direction, short x, short y,
short z, short w0, short wy, int color, int overlapColor, byte upSkyLight, byte blockLight)
{
color = ColorUtil.applyShade(color, MC.getShade(direction));
@@ -1,7 +1,7 @@
package com.seibel.lod.core.objects.a7.datatype.column;
import com.seibel.lod.core.config.Config;
import com.seibel.lod.core.enums.config.VerticalQuality;
import com.seibel.lod.core.enums.config.EVerticalQuality;
import com.seibel.lod.core.objects.a7.DHLevel;
import com.seibel.lod.core.objects.a7.data.DataFile;
import com.seibel.lod.core.objects.a7.data.DataFileHandler;
@@ -45,7 +45,7 @@ public class ColumnDataLoader extends DataSourceSaver {
return generateFilePathAndName(levelFolderPath, sectionPos, Config.Client.Graphics.Quality.verticalQuality.get());
}
public File generateFilePathAndName(File levelFolderPath, DhSectionPos sectionPos, VerticalQuality quality) {
public File generateFilePathAndName(File levelFolderPath, DhSectionPos sectionPos, EVerticalQuality quality) {
return new File(levelFolderPath, "cache" + File.separator + quality.toString() + File.separator +
String.format("%s_v%d-%s%s", clazz.getSimpleName(), COLUMN_DATA_LOADER_VERSION,
sectionPos.serialize(), DataFileHandler.FILE_EXTENSION));
@@ -54,8 +54,8 @@ public class ColumnDataLoader extends DataSourceSaver {
@Override
public List<File> foldersToScan(File levelFolderPath) {
File cacheFolder = new File(levelFolderPath, "cache");
List<File> foldersToScan = new ArrayList<>(VerticalQuality.values().length);
for (VerticalQuality q : VerticalQuality.values()) {
List<File> foldersToScan = new ArrayList<>(EVerticalQuality.values().length);
for (EVerticalQuality q : EVerticalQuality.values()) {
foldersToScan.add(new File(cacheFolder, q.toString()));
}
return foldersToScan;
@@ -1,6 +1,6 @@
package com.seibel.lod.core.objects.a7.datatype.column;
import com.seibel.lod.core.enums.LodDirection;
import com.seibel.lod.core.enums.ELodDirection;
import com.seibel.lod.core.objects.LodDataView;
import com.seibel.lod.core.objects.a7.DHLevel;
import com.seibel.lod.core.objects.a7.LodQuadTree;
@@ -9,8 +9,6 @@ import com.seibel.lod.core.objects.a7.data.DataSourceLoader;
import com.seibel.lod.core.objects.a7.pos.DhSectionPos;
import com.seibel.lod.core.objects.a7.render.RenderDataSource;
import com.seibel.lod.core.objects.a7.render.RenderBuffer;
import com.seibel.lod.core.util.LodThreadFactory;
import com.seibel.lod.core.util.LodUtil;
import java.io.DataInputStream;
import java.io.DataOutputStream;
@@ -18,8 +16,6 @@ import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicReference;
public class ColumnDatatype implements RenderDataSource, IColumnDatatype {
@@ -268,8 +264,8 @@ public class ColumnDatatype implements RenderDataSource, IColumnDatatype {
private void tryBuildBuffer(LodQuadTree quadTree) {
if (inBuildRenderBuffer == null) {
ColumnDatatype[] data = new ColumnDatatype[LodDirection.ADJ_DIRECTIONS.length];
for (LodDirection direction : LodDirection.ADJ_DIRECTIONS) {
ColumnDatatype[] data = new ColumnDatatype[ELodDirection.ADJ_DIRECTIONS.length];
for (ELodDirection direction : ELodDirection.ADJ_DIRECTIONS) {
LodSection section = quadTree.getSection(sectionPos.getAdjacent(direction)); //FIXME: Handle traveling through different detail levels
if (section.getRenderContainer() != null && section.getRenderContainer() instanceof ColumnRenderBuffer) {
data[direction.ordinal()-2] = ((ColumnDatatype) section.getRenderContainer());
@@ -6,10 +6,10 @@ import com.seibel.lod.core.builders.lodBuilding.LodBuilder;
import com.seibel.lod.core.builders.lodBuilding.bufferBuilding.CubicLodTemplate;
import com.seibel.lod.core.builders.lodBuilding.bufferBuilding.LodBufferBuilderFactory;
import com.seibel.lod.core.builders.lodBuilding.bufferBuilding.LodQuadBuilder;
import com.seibel.lod.core.enums.LodDirection;
import com.seibel.lod.core.enums.config.GpuUploadMethod;
import com.seibel.lod.core.enums.rendering.DebugMode;
import com.seibel.lod.core.enums.rendering.GLProxyContext;
import com.seibel.lod.core.enums.ELodDirection;
import com.seibel.lod.core.enums.config.EGpuUploadMethod;
import com.seibel.lod.core.enums.rendering.EDebugMode;
import com.seibel.lod.core.enums.rendering.EGLProxyContext;
import com.seibel.lod.core.logging.ConfigBasedLogger;
import com.seibel.lod.core.logging.DhLoggerBuilder;
import com.seibel.lod.core.objects.a7.UncheckedInterruptedException;
@@ -51,7 +51,7 @@ public class ColumnRenderBuffer extends RenderBuffer {
}
private void _uploadBuffersDirect(LodQuadBuilder builder, GpuUploadMethod method) throws InterruptedException {
private void _uploadBuffersDirect(LodQuadBuilder builder, EGpuUploadMethod method) throws InterruptedException {
resize(builder.getCurrentNeededVertexBufferCount());
long remainingNS = 0;
long BPerNS = Config.Client.Advanced.Buffers.gpuUploadPerMegabyteInMilliseconds.get();
@@ -89,7 +89,7 @@ public class ColumnRenderBuffer extends RenderBuffer {
}
}
private void _uploadBuffersMapped(LodQuadBuilder builder, GpuUploadMethod method)
private void _uploadBuffersMapped(LodQuadBuilder builder, EGpuUploadMethod method)
{
resize(builder.getCurrentNeededVertexBufferCount());
for (int i=0; i<vbos.length; i++) {
@@ -127,7 +127,7 @@ public class ColumnRenderBuffer extends RenderBuffer {
}
}
public void uploadBuffer(LodQuadBuilder builder, GpuUploadMethod method) throws InterruptedException {
public void uploadBuffer(LodQuadBuilder builder, EGpuUploadMethod method) throws InterruptedException {
if (method.useEarlyMapping) {
_uploadBuffersMapped(builder, method);
} else {
@@ -204,9 +204,9 @@ public class ColumnRenderBuffer extends RenderBuffer {
try {
EVENT_LOGGER.trace("RenderRegion start Upload @ {}", data.sectionPos);
GLProxy glProxy = GLProxy.getInstance();
GpuUploadMethod method = GLProxy.getInstance().getGpuUploadMethod();
GLProxyContext oldContext = glProxy.getGlContext();
glProxy.setGlContext(GLProxyContext.LOD_BUILDER);
EGpuUploadMethod method = GLProxy.getInstance().getGpuUploadMethod();
EGLProxyContext oldContext = glProxy.getGlContext();
glProxy.setGlContext(EGLProxyContext.LOD_BUILDER);
ColumnRenderBuffer buffer = usedBuffer!=null ? usedBuffer : new ColumnRenderBuffer();
try {
buffer.uploadBuffer(builder, method);
@@ -239,7 +239,7 @@ public class ColumnRenderBuffer extends RenderBuffer {
private static void makeLodRenderData(LodQuadBuilder quadBuilder, ColumnDatatype region, ColumnDatatype[] adjRegions) {
// Variable initialization
DebugMode debugMode = Config.Client.Advanced.Debugging.debugMode.get();
EDebugMode debugMode = Config.Client.Advanced.Debugging.debugMode.get();
byte detailLevel = region.getDataDetail();
int dataSize = 1 << detailLevel;
@@ -268,7 +268,7 @@ public class ColumnRenderBuffer extends RenderBuffer {
// We avoid cases where the adjPosition is in player chunk while the position is
// not
// to always have a wall underwater
for (LodDirection lodDirection : LodDirection.ADJ_DIRECTIONS) {
for (ELodDirection lodDirection : ELodDirection.ADJ_DIRECTIONS) {
try {
int xAdj = x + lodDirection.getNormal().x;
int zAdj = z + lodDirection.getNormal().z;
@@ -308,8 +308,8 @@ public class ColumnRenderBuffer extends RenderBuffer {
adjData[lodDirection.ordinal() - 2] = new ColumnArrayView[2];
adjData[lodDirection.ordinal() - 2][0] = adjRegion.getVerticalDataView(xAdj, zAdj);
adjData[lodDirection.ordinal() - 2][1] = adjRegion.getVerticalDataView(
xAdj + (lodDirection.getAxis()==LodDirection.Axis.X ? 0 : 1),
zAdj + (lodDirection.getAxis()==LodDirection.Axis.Z ? 0 : 1));
xAdj + (lodDirection.getAxis()== ELodDirection.Axis.X ? 0 : 1),
zAdj + (lodDirection.getAxis()== ELodDirection.Axis.Z ? 0 : 1));
}
} catch (RuntimeException e) {
EVENT_LOGGER.warn("Failed to get adj data for [{}:{},{}] at [{}]", detailLevel, x, z, lodDirection);
@@ -1,13 +1,12 @@
package com.seibel.lod.core.objects.a7.io;
import com.seibel.lod.core.enums.config.ServerFolderNameMode;
import com.seibel.lod.core.enums.config.EServerFolderNameMode;
import com.seibel.lod.core.handlers.LodDimensionFinder;
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
import com.seibel.lod.core.logging.ConfigBasedLogger;
import com.seibel.lod.core.objects.ParsedIp;
import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton;
import com.seibel.lod.core.wrapperInterfaces.minecraft.IMinecraftClientWrapper;
import com.seibel.lod.core.wrapperInterfaces.world.IWorldWrapper;
import org.apache.logging.log4j.LogManager;
import java.io.File;
@@ -81,18 +80,18 @@ public class DHFolderHandler {
// determine the format of the folder name
ServerFolderNameMode folderNameMode = CONFIG.client().multiplayer().getServerFolderNameMode();
if (folderNameMode == ServerFolderNameMode.AUTO)
EServerFolderNameMode folderNameMode = CONFIG.client().multiplayer().getServerFolderNameMode();
if (folderNameMode == EServerFolderNameMode.AUTO)
{
if (parsedIp.isLan())
{
// LAN
folderNameMode = ServerFolderNameMode.NAME_IP;
folderNameMode = EServerFolderNameMode.NAME_IP;
}
else
{
// normal multiplayer
folderNameMode = ServerFolderNameMode.NAME_IP_PORT;
folderNameMode = EServerFolderNameMode.NAME_IP_PORT;
}
}
String serverName = MC.getCurrentServerName().replaceAll(INVALID_FILE_CHARACTERS_REGEX, "");
@@ -3,8 +3,8 @@ package com.seibel.lod.core.objects.a7.io;
import com.seibel.lod.core.api.internal.InternalApiShared;
import com.seibel.lod.core.builders.lodBuilding.LodBuilder;
import com.seibel.lod.core.builders.lodBuilding.LodBuilderConfig;
import com.seibel.lod.core.enums.config.DistanceGenerationMode;
import com.seibel.lod.core.enums.config.VerticalQuality;
import com.seibel.lod.core.enums.config.EDistanceGenerationMode;
import com.seibel.lod.core.enums.config.EVerticalQuality;
import com.seibel.lod.core.handlers.LodDimensionFileHandler;
import com.seibel.lod.core.handlers.LodDimensionFinder;
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
@@ -38,7 +38,7 @@ public class LevelToFileMatcher {
() -> CONFIG.client().advanced().debugging().debugSwitch().getLogFileSubDimEvent());
/** Increasing this will increase accuracy but increase calculation time */
private static final VerticalQuality VERTICAL_QUALITY_TO_TEST_WITH = VerticalQuality.LOW;
private static final EVerticalQuality VERTICAL_QUALITY_TO_TEST_WITH = EVerticalQuality.LOW;
public static final String THREAD_NAME = "Level-To-File-Matcher";
@@ -180,7 +180,7 @@ public class LevelToFileMatcher {
newlyLoadedDim.regions.set(playerRegionPos.x, playerRegionPos.z, new LodRegion(LodUtil.BLOCK_DETAIL_LEVEL, playerRegionPos, VERTICAL_QUALITY_TO_TEST_WITH));
// generate a LOD to test against
boolean lodGenerated = InternalApiShared.lodBuilder.generateLodNodeFromChunk(newlyLoadedDim, newlyLoadedChunk, new LodBuilderConfig(DistanceGenerationMode.FULL), true, true);
boolean lodGenerated = InternalApiShared.lodBuilder.generateLodNodeFromChunk(newlyLoadedDim, newlyLoadedChunk, new LodBuilderConfig(EDistanceGenerationMode.FULL), true, true);
if (!lodGenerated)
return null;
@@ -369,7 +369,7 @@ public class LevelToFileMatcher {
// check if there is at least one VerticalQuality folder in this directory
for (File internalFolder : potentialFolder.listFiles())
{
if (VerticalQuality.getByName(internalFolder.getName()) != null)
if (EVerticalQuality.getByName(internalFolder.getName()) != null)
{
// one of the internal folders is a VerticalQuality folder
return true;
@@ -1,6 +1,6 @@
package com.seibel.lod.core.objects.a7.pos;
import com.seibel.lod.core.enums.LodDirection;
import com.seibel.lod.core.enums.ELodDirection;
import com.seibel.lod.core.util.LodUtil;
import java.util.function.Consumer;
@@ -62,7 +62,7 @@ public class DhSectionPos {
return new DhSectionPos((byte) (sectionDetail + 1), sectionX / 2, sectionZ / 2);
}
public DhSectionPos getAdjacent(LodDirection dir) {
public DhSectionPos getAdjacent(ELodDirection dir) {
return new DhSectionPos(sectionDetail, sectionX + dir.getNormal().x, sectionZ + dir.getNormal().z);
}
@@ -19,13 +19,9 @@
package com.seibel.lod.core.objects.a7.render;
import com.seibel.lod.core.builders.lodBuilding.bufferBuilding.LodQuadBuilder;
import com.seibel.lod.core.enums.config.GpuUploadMethod;
import com.seibel.lod.core.render.LodRenderProgram;
import com.seibel.lod.core.util.StatsMap;
import java.util.ConcurrentModificationException;
public abstract class RenderBuffer implements AutoCloseable
{
// ======================================================================
@@ -20,10 +20,10 @@
package com.seibel.lod.core.objects.lod;
import com.seibel.lod.core.api.internal.ClientApi;
import com.seibel.lod.core.enums.config.DistanceGenerationMode;
import com.seibel.lod.core.enums.config.DropoffQuality;
import com.seibel.lod.core.enums.config.GenerationPriority;
import com.seibel.lod.core.enums.config.VerticalQuality;
import com.seibel.lod.core.enums.config.EDistanceGenerationMode;
import com.seibel.lod.core.enums.config.EDropoffQuality;
import com.seibel.lod.core.enums.config.EGenerationPriority;
import com.seibel.lod.core.enums.config.EVerticalQuality;
import com.seibel.lod.core.handlers.LodDimensionFileHandler;
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
import com.seibel.lod.core.logging.DhLoggerBuilder;
@@ -337,11 +337,11 @@ public class LodDimension
}
isExpanding = true;
VerticalQuality verticalQuality = CONFIG.client().graphics().quality().getVerticalQuality();
DropoffQuality dropoffQuality = CONFIG.client().graphics().quality().getDropoffQuality();
if (dropoffQuality == DropoffQuality.AUTO)
EVerticalQuality verticalQuality = CONFIG.client().graphics().quality().getVerticalQuality();
EDropoffQuality dropoffQuality = CONFIG.client().graphics().quality().getDropoffQuality();
if (dropoffQuality == EDropoffQuality.AUTO)
dropoffQuality = CONFIG.client().graphics().quality().getLodChunkRenderDistance() < 128 ?
DropoffQuality.SMOOTH_DROPOFF : DropoffQuality.PERFORMANCE_FOCUSED;
EDropoffQuality.SMOOTH_DROPOFF : EDropoffQuality.PERFORMANCE_FOCUSED;
int dropoffSwitch = dropoffQuality.fastModeSwitch;
// don't run the expander multiple times
// for the same location
@@ -462,7 +462,7 @@ public class LodDimension
* Returns every position that need to be generated based on the position of the player
*/
public PosToGenerateContainer getPosToGenerate(int maxDataToGenerate, int playerBlockPosX, int playerBlockPosZ,
GenerationPriority priority, DistanceGenerationMode genMode)
EGenerationPriority priority, EDistanceGenerationMode genMode)
{
PosToGenerateContainer posToGenerate;
posToGenerate = new PosToGenerateContainer(maxDataToGenerate, playerBlockPosX, playerBlockPosZ);
@@ -470,7 +470,7 @@ public class LodDimension
// This ensures that we don't spawn way too many regions without finish flushing them first.
//if (dirtiedRegionsRoughCount > 16) return posToGenerate;
GenerationPriority allowedPriority = dirtiedRegionsRoughCount>12 ? GenerationPriority.NEAR_FIRST : priority;
EGenerationPriority allowedPriority = dirtiedRegionsRoughCount>12 ? EGenerationPriority.NEAR_FIRST : priority;
Pos2D minPos = regions.getMinInRange();
iterateByDistance((int x, int z) -> {
boolean isCloseRange = (Math.abs(x-halfWidth)+Math.abs(z-halfWidth)<=2);
@@ -592,7 +592,7 @@ public class LodDimension
}
/** Returns true if a region exists at the given LevelPos */
public boolean doesDataExist(byte detailLevel, int posX, int posZ, DistanceGenerationMode requiredMode)
public boolean doesDataExist(byte detailLevel, int posX, int posZ, EDistanceGenerationMode requiredMode)
{
LodRegion region = getRegion(detailLevel, posX, posZ);
return region != null && region.doesDataExist(detailLevel, posX, posZ, requiredMode);
@@ -602,7 +602,7 @@ public class LodDimension
* Loads the region at the given RegionPos from file,
* if a file exists for that region.
*/
public LodRegion getRegionFromFile(DHRegionPos regionPos, byte detailLevel, VerticalQuality verticalQuality)
public LodRegion getRegionFromFile(DHRegionPos regionPos, byte detailLevel, EVerticalQuality verticalQuality)
{
return fileHandler != null ? fileHandler.loadRegionFromFile(detailLevel, regionPos, verticalQuality) :
new LodRegion(detailLevel, regionPos, verticalQuality);
@@ -611,7 +611,7 @@ public class LodDimension
* Loads the region at the given region from file,
* if a file exists for that region.
*/
public LodRegion getRegionFromFile(LodRegion existingRegion, byte detailLevel, VerticalQuality verticalQuality)
public LodRegion getRegionFromFile(LodRegion existingRegion, byte detailLevel, EVerticalQuality verticalQuality)
{
return fileHandler != null ? fileHandler.loadRegionFromFile(detailLevel, existingRegion, verticalQuality) :
new LodRegion(detailLevel, existingRegion.getRegionPos(), verticalQuality);
@@ -23,10 +23,10 @@ import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.concurrent.atomic.AtomicInteger;
import com.seibel.lod.core.enums.config.DistanceGenerationMode;
import com.seibel.lod.core.enums.config.DropoffQuality;
import com.seibel.lod.core.enums.config.GenerationPriority;
import com.seibel.lod.core.enums.config.VerticalQuality;
import com.seibel.lod.core.enums.config.EDistanceGenerationMode;
import com.seibel.lod.core.enums.config.EDropoffQuality;
import com.seibel.lod.core.enums.config.EGenerationPriority;
import com.seibel.lod.core.enums.config.EVerticalQuality;
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
import com.seibel.lod.core.objects.*;
import com.seibel.lod.core.util.DataPointUtil;
@@ -65,7 +65,7 @@ public class LodRegion {
// private final boolean[] preGeneratedChunkPos;
/** the vertical quality of this region */
private final VerticalQuality verticalQuality;
private final EVerticalQuality verticalQuality;
/** this region's x RegionPos */
public final int regionPosX;
@@ -87,7 +87,7 @@ public class LodRegion {
return (byte)LodUtil.clamp(LodUtil.CHUNK_DETAIL_LEVEL+1, farModeLevel, LodUtil.DETAIL_OPTIONS - 1);
}
public LodRegion(byte minDetailLevel, DHRegionPos regionPos, VerticalQuality verticalQuality) {
public LodRegion(byte minDetailLevel, DHRegionPos regionPos, EVerticalQuality verticalQuality) {
this.minDetailLevel = minDetailLevel;
this.regionPosX = regionPos.x;
this.regionPosZ = regionPos.z;
@@ -179,7 +179,7 @@ public class LodRegion {
);*/
}
if (!doesDataExist(detailLevel, posX, posZ, DistanceGenerationMode.values()[DataPointUtil.getGenerationMode(data[0]) - 1])) { //FIXME: -1 case NONE has value of 1 but slot of 0
if (!doesDataExist(detailLevel, posX, posZ, EDistanceGenerationMode.values()[DataPointUtil.getGenerationMode(data[0]) - 1])) { //FIXME: -1 case NONE has value of 1 but slot of 0
throw new RuntimeException("Data still doesn't exist after addChunkOfData!");
}
@@ -236,7 +236,7 @@ public class LodRegion {
* understand
*/
public void getPosToGenerate(PosToGenerateContainer posToGenerate, int playerBlockPosX, int playerBlockPosZ,
GenerationPriority priority, DistanceGenerationMode genMode, boolean shouldSort) {
EGenerationPriority priority, EDistanceGenerationMode genMode, boolean shouldSort) {
getPosToGenerate(posToGenerate, LodUtil.REGION_DETAIL_LEVEL, 0, 0, playerBlockPosX, playerBlockPosZ,
priority, genMode, shouldSort, true);
@@ -251,7 +251,7 @@ public class LodRegion {
* FIXME This is.... absolute hell currently. Needs clean up.
*/
private void getPosToGenerate(PosToGenerateContainer posToGenerate, byte detailLevel, int offsetPosX, int offsetPosZ,
int playerPosX, int playerPosZ, GenerationPriority priority, DistanceGenerationMode genMode, boolean shouldSort, boolean needFarPos) {
int playerPosX, int playerPosZ, EGenerationPriority priority, EDistanceGenerationMode genMode, boolean shouldSort, boolean needFarPos) {
// equivalent to 2^(...)
int size = 1 << (LodUtil.REGION_DETAIL_LEVEL - detailLevel);
@@ -262,11 +262,11 @@ public class LodRegion {
byte childDetailLevel = (byte) (detailLevel - 1);
int childOffsetPosX = offsetPosX * 2;
int childOffsetPosZ = offsetPosZ * 2;
DistanceGenerationMode testerGenMode = genMode;//detailLevel >= LodUtil.CHUNK_DETAIL_LEVEL ? DistanceGenerationMode.NONE : genMode;
EDistanceGenerationMode testerGenMode = genMode;//detailLevel >= LodUtil.CHUNK_DETAIL_LEVEL ? DistanceGenerationMode.NONE : genMode;
byte targetDetailLevel = DetailDistanceUtil.getDetailLevelFromDistance(minDistance);
int farModeSwitchLevel = (priority == GenerationPriority.NEAR_FIRST) ? -1 : calculateFarModeSwitch(targetDetailLevel);
if (priority == GenerationPriority.FAR_FIRST) farModeSwitchLevel = 8;
int farModeSwitchLevel = (priority == EGenerationPriority.NEAR_FIRST) ? -1 : calculateFarModeSwitch(targetDetailLevel);
if (priority == EGenerationPriority.FAR_FIRST) farModeSwitchLevel = 8;
boolean doesDataExist = doesDataExist(detailLevel, offsetPosX + regionPosX * size, offsetPosZ + regionPosZ * size, testerGenMode);
boolean isFarModeSwitchEdge = needFarPos && detailLevel <= farModeSwitchLevel;
@@ -296,8 +296,8 @@ public class LodRegion {
}
public byte getRenderDetailLevelAt(int playerPosX, int playerPosZ, byte detailLevel, int offsetX, int offsetZ) {
GenerationPriority generationPriority = CONFIG.client().worldGenerator().getResolvedGenerationPriority();
DropoffQuality dropoffQuality = CONFIG.client().graphics().quality().getResolvedDropoffQuality();
EGenerationPriority generationPriority = CONFIG.client().worldGenerator().getResolvedGenerationPriority();
EDropoffQuality dropoffQuality = CONFIG.client().graphics().quality().getResolvedDropoffQuality();
double minDistance = LevelPosUtil.minDistance(LodUtil.REGION_DETAIL_LEVEL, regionPosX, regionPosZ,
playerPosX, playerPosZ);
@@ -321,9 +321,9 @@ public class LodRegion {
int playerPosZ)
{
// use FAR_FIRST on local worlds and NEAR_FIRST on servers
GenerationPriority generationPriority = CONFIG.client().worldGenerator().getResolvedGenerationPriority();
EGenerationPriority generationPriority = CONFIG.client().worldGenerator().getResolvedGenerationPriority();
DropoffQuality dropoffQuality = CONFIG.client().graphics().quality().getResolvedDropoffQuality();
EDropoffQuality dropoffQuality = CONFIG.client().graphics().quality().getResolvedDropoffQuality();
getPosToRender(posToRender, playerPosX, playerPosZ, generationPriority, dropoffQuality);
}
@@ -336,7 +336,7 @@ public class LodRegion {
* understand
*/
private void getPosToRender(PosToRenderContainer posToRender, int playerPosX, int playerPosZ,
GenerationPriority priority, DropoffQuality dropoffQuality) {
EGenerationPriority priority, EDropoffQuality dropoffQuality) {
double minDistance = LevelPosUtil.minDistance(LodUtil.REGION_DETAIL_LEVEL, regionPosX, regionPosZ, playerPosX, playerPosZ);
byte targetLevel = DetailDistanceUtil.getDetailLevelFromDistance(minDistance);
if (targetLevel <= dropoffQuality.fastModeSwitch) {
@@ -346,9 +346,9 @@ public class LodRegion {
// FarModeSwitchLevel or above is the level where a giant block of lod is not acceptable even if not all child data exist.
double centerDistance = LevelPosUtil.centerDistance(LodUtil.REGION_DETAIL_LEVEL, regionPosX, regionPosZ, playerPosX, playerPosZ);
targetLevel = DetailDistanceUtil.getDetailLevelFromDistance(centerDistance);
byte farModeSwitchLevel = (priority == GenerationPriority.NEAR_FIRST) ? 0 :
byte farModeSwitchLevel = (priority == EGenerationPriority.NEAR_FIRST) ? 0 :
calculateFarModeSwitch(targetLevel);
if (priority == GenerationPriority.FAR_FIRST) farModeSwitchLevel = 8;
if (priority == EGenerationPriority.FAR_FIRST) farModeSwitchLevel = 8;
getPosToRenderFlat(posToRender, LodUtil.REGION_DETAIL_LEVEL, 0, 0, targetLevel, farModeSwitchLevel);
}
}
@@ -362,7 +362,7 @@ public class LodRegion {
* out part of it
*/
private void getPosToRender(PosToRenderContainer posToRender, byte detailLevel, int offsetPosX, int offsetPosZ, int playerPosX,
int playerPosZ, GenerationPriority priority) {
int playerPosZ, EGenerationPriority priority) {
// equivalent to 2^(...)
int size = 1 << (LodUtil.REGION_DETAIL_LEVEL - detailLevel);
@@ -370,8 +370,8 @@ public class LodRegion {
double minDistance = LevelPosUtil.minDistance(detailLevel, offsetPosX + regionPosX*size, offsetPosZ + regionPosZ*size, playerPosX, playerPosZ);
byte minLevel = DetailDistanceUtil.getDetailLevelFromDistance(minDistance);
// FarModeSwitchLevel or above is the level where a giant block of lod is not acceptable even if not all child data exist.
byte farModeSwitchLevel = (priority == GenerationPriority.NEAR_FIRST) ? 0 : calculateFarModeSwitch(minLevel);
if (priority == GenerationPriority.FAR_FIRST) farModeSwitchLevel = 8;
byte farModeSwitchLevel = (priority == EGenerationPriority.NEAR_FIRST) ? 0 : calculateFarModeSwitch(minLevel);
if (priority == EGenerationPriority.FAR_FIRST) farModeSwitchLevel = 8;
if (detailLevel <= minLevel) {
posToRender.addPosToRender(detailLevel, offsetPosX + regionPosX * size, offsetPosZ + regionPosZ * size);
@@ -385,7 +385,7 @@ public class LodRegion {
// Giant block is not acceptable. So leave empty void if data doesn't exist.
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, EDistanceGenerationMode.NONE)) {
getPosToRender(posToRender, childDetailLevel, offsetPosX*2 + x, offsetPosZ*2 + z, playerPosX,
playerPosZ, priority);
}
@@ -396,7 +396,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, EDistanceGenerationMode.NONE)) {
childrenCount++;
}
}
@@ -434,7 +434,7 @@ public class LodRegion {
// Giant block is not acceptable. So leave empty void if data doesn't exist.
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, EDistanceGenerationMode.NONE)) {
getPosToRenderFlat(posToRender, childDetailLevel, offsetPosX*2 + x, offsetPosZ*2 + z, targetLevel, farModeSwitchLevel);
}
}
@@ -444,7 +444,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.RENDERABLE)) {
if (doesDataExist(childDetailLevel, childPosX + x, childPosZ + z, EDistanceGenerationMode.RENDERABLE)) {
childrenCount++;
}
}
@@ -591,14 +591,14 @@ public class LodRegion {
/**
* Returns if data exists at the given relative Pos.
*/
public boolean doesDataExist(byte detailLevel, int posX, int posZ, DistanceGenerationMode requiredMode) {
public boolean doesDataExist(byte detailLevel, int posX, int posZ, EDistanceGenerationMode requiredMode) {
if (detailLevel < minDetailLevel || dataContainer[detailLevel] == null)
return false;
int modPosX = LevelPosUtil.getRegionModule(detailLevel, posX);
int modPosZ = LevelPosUtil.getRegionModule(detailLevel, posZ);
if (!dataContainer[detailLevel].doesItExist(modPosX, modPosZ)) return false;
if (requiredMode==DistanceGenerationMode.NONE) return true;
if (requiredMode== EDistanceGenerationMode.NONE) return true;
byte mode = getGenerationMode(detailLevel, posX, posZ);
return (mode>=requiredMode.complexity);
}
@@ -712,7 +712,7 @@ public class LodRegion {
return count;
}
public VerticalQuality getVerticalQuality() {
public EVerticalQuality getVerticalQuality() {
return verticalQuality;
}
@@ -20,7 +20,7 @@
package com.seibel.lod.core.objects.opengl;
import com.seibel.lod.core.builders.lodBuilding.bufferBuilding.LodQuadBuilder;
import com.seibel.lod.core.enums.LodDirection;
import com.seibel.lod.core.enums.ELodDirection;
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
import com.seibel.lod.core.objects.LodDataView;
import com.seibel.lod.core.util.ColorUtil;
@@ -50,103 +50,103 @@ public class LodBox
// == 255;
if (!skipTop)
builder.addQuadUp(x, maxY, z, xSize, zSize, ColorUtil.applyShade(color, MC.getShade(LodDirection.UP)), skyLightTop, blockLight);
builder.addQuadUp(x, maxY, z, xSize, zSize, ColorUtil.applyShade(color, MC.getShade(ELodDirection.UP)), skyLightTop, blockLight);
if (!skipBot)
builder.addQuadDown(x, y, z, xSize, zSize, ColorUtil.applyShade(color, MC.getShade(LodDirection.DOWN)), skyLightBot, blockLight);
builder.addQuadDown(x, y, z, xSize, zSize, ColorUtil.applyShade(color, MC.getShade(ELodDirection.DOWN)), skyLightBot, blockLight);
//If the adj pos is at the same level we cull the faces normally, otherwise we divide the face in two and cull the two part separately
//NORTH face vertex creation
{
LodDataView[] adjDataNorth = adjData[LodDirection.NORTH.ordinal() - 2];
int adjOverlapNorth = adjFillBlack[LodDirection.NORTH.ordinal() - 2] ? ColorUtil.BLACK : ColorUtil.TRANSPARENT;
LodDataView[] adjDataNorth = adjData[ELodDirection.NORTH.ordinal() - 2];
int adjOverlapNorth = adjFillBlack[ELodDirection.NORTH.ordinal() - 2] ? ColorUtil.BLACK : ColorUtil.TRANSPARENT;
if (adjDataNorth == null)
{
builder.addQuadAdj(LodDirection.NORTH, x, y, z, xSize, ySize, color, (byte) 15, blockLight);
builder.addQuadAdj(ELodDirection.NORTH, x, y, z, xSize, ySize, color, (byte) 15, blockLight);
}
else if (adjDataNorth.length == 1)
{
makeAdjQuads(builder, adjDataNorth[0], LodDirection.NORTH, x, y, z, xSize, ySize,
makeAdjQuads(builder, adjDataNorth[0], ELodDirection.NORTH, x, y, z, xSize, ySize,
color, adjOverlapNorth, skyLightTop, blockLight);
}
else
{
makeAdjQuads(builder, adjDataNorth[0], LodDirection.NORTH, x, y, z, (short) (xSize / 2), ySize,
makeAdjQuads(builder, adjDataNorth[0], ELodDirection.NORTH, x, y, z, (short) (xSize / 2), ySize,
color, adjOverlapNorth, skyLightTop, blockLight);
makeAdjQuads(builder, adjDataNorth[1], LodDirection.NORTH, (short) (x + xSize / 2), y, z, (short) (xSize / 2), ySize,
makeAdjQuads(builder, adjDataNorth[1], ELodDirection.NORTH, (short) (x + xSize / 2), y, z, (short) (xSize / 2), ySize,
color, adjOverlapNorth, skyLightTop, blockLight);
}
}
//SOUTH face vertex creation
{
LodDataView[] adjDataSouth = adjData[LodDirection.SOUTH.ordinal() - 2];
int adjOverlapSouth = adjFillBlack[LodDirection.SOUTH.ordinal() - 2] ? ColorUtil.BLACK : ColorUtil.TRANSPARENT;
LodDataView[] adjDataSouth = adjData[ELodDirection.SOUTH.ordinal() - 2];
int adjOverlapSouth = adjFillBlack[ELodDirection.SOUTH.ordinal() - 2] ? ColorUtil.BLACK : ColorUtil.TRANSPARENT;
if (adjDataSouth == null)
{
builder.addQuadAdj(LodDirection.SOUTH, x, y, maxZ, xSize, ySize, color, (byte) 15, blockLight);
builder.addQuadAdj(ELodDirection.SOUTH, x, y, maxZ, xSize, ySize, color, (byte) 15, blockLight);
}
else if (adjDataSouth.length == 1)
{
makeAdjQuads(builder, adjDataSouth[0], LodDirection.SOUTH, x, y, maxZ, xSize, ySize,
makeAdjQuads(builder, adjDataSouth[0], ELodDirection.SOUTH, x, y, maxZ, xSize, ySize,
color, adjOverlapSouth, skyLightTop, blockLight);
}
else
{
makeAdjQuads(builder, adjDataSouth[0], LodDirection.SOUTH, x, y, maxZ, (short) (xSize / 2), ySize,
makeAdjQuads(builder, adjDataSouth[0], ELodDirection.SOUTH, x, y, maxZ, (short) (xSize / 2), ySize,
color, adjOverlapSouth, skyLightTop, blockLight);
makeAdjQuads(builder, adjDataSouth[1], LodDirection.SOUTH, (short) (x + xSize / 2), y, maxZ, (short) (xSize / 2), ySize,
makeAdjQuads(builder, adjDataSouth[1], ELodDirection.SOUTH, (short) (x + xSize / 2), y, maxZ, (short) (xSize / 2), ySize,
color, adjOverlapSouth, skyLightTop, blockLight);
}
}
//WEST face vertex creation
{
LodDataView[] adjDataWest = adjData[LodDirection.WEST.ordinal() - 2];
int adjOverlapWest = adjFillBlack[LodDirection.WEST.ordinal() - 2] ? ColorUtil.BLACK : ColorUtil.TRANSPARENT;
LodDataView[] adjDataWest = adjData[ELodDirection.WEST.ordinal() - 2];
int adjOverlapWest = adjFillBlack[ELodDirection.WEST.ordinal() - 2] ? ColorUtil.BLACK : ColorUtil.TRANSPARENT;
if (adjDataWest == null)
{
builder.addQuadAdj(LodDirection.WEST, x, y, z, zSize, ySize, color, (byte) 15, blockLight);
builder.addQuadAdj(ELodDirection.WEST, x, y, z, zSize, ySize, color, (byte) 15, blockLight);
}
else if (adjDataWest.length == 1)
{
makeAdjQuads(builder, adjDataWest[0], LodDirection.WEST, x, y, z, zSize, ySize,
makeAdjQuads(builder, adjDataWest[0], ELodDirection.WEST, x, y, z, zSize, ySize,
color, adjOverlapWest, skyLightTop, blockLight);
}
else
{
makeAdjQuads(builder, adjDataWest[0], LodDirection.WEST, x, y, z, (short) (zSize / 2), ySize,
makeAdjQuads(builder, adjDataWest[0], ELodDirection.WEST, x, y, z, (short) (zSize / 2), ySize,
color, adjOverlapWest, skyLightTop, blockLight);
makeAdjQuads(builder, adjDataWest[1], LodDirection.WEST, x, y, (short) (z + zSize / 2), (short) (zSize / 2), ySize,
makeAdjQuads(builder, adjDataWest[1], ELodDirection.WEST, x, y, (short) (z + zSize / 2), (short) (zSize / 2), ySize,
color, adjOverlapWest, skyLightTop, blockLight);
}
}
//EAST face vertex creation
{
LodDataView[] adjDataEast = adjData[LodDirection.EAST.ordinal() - 2];
int adjOverlapEast = adjFillBlack[LodDirection.EAST.ordinal() - 2] ? ColorUtil.BLACK : ColorUtil.TRANSPARENT;
if (adjData[LodDirection.EAST.ordinal() - 2] == null)
LodDataView[] adjDataEast = adjData[ELodDirection.EAST.ordinal() - 2];
int adjOverlapEast = adjFillBlack[ELodDirection.EAST.ordinal() - 2] ? ColorUtil.BLACK : ColorUtil.TRANSPARENT;
if (adjData[ELodDirection.EAST.ordinal() - 2] == null)
{
builder.addQuadAdj(LodDirection.EAST, maxX, y, z, zSize, ySize, color, (byte) 15, blockLight);
builder.addQuadAdj(ELodDirection.EAST, maxX, y, z, zSize, ySize, color, (byte) 15, blockLight);
}
else if (adjDataEast.length == 1)
{
makeAdjQuads(builder, adjDataEast[0], LodDirection.EAST, maxX, y, z, zSize, ySize,
makeAdjQuads(builder, adjDataEast[0], ELodDirection.EAST, maxX, y, z, zSize, ySize,
color, adjOverlapEast, skyLightTop, blockLight);
}
else
{
makeAdjQuads(builder, adjDataEast[0], LodDirection.EAST, maxX, y, z, (short) (zSize / 2), ySize,
makeAdjQuads(builder, adjDataEast[0], ELodDirection.EAST, maxX, y, z, (short) (zSize / 2), ySize,
color, adjOverlapEast, skyLightTop, blockLight);
makeAdjQuads(builder, adjDataEast[1], LodDirection.EAST, maxX, y, (short) (z + zSize / 2), (short) (zSize / 2), ySize,
makeAdjQuads(builder, adjDataEast[1], ELodDirection.EAST, maxX, y, (short) (z + zSize / 2), (short) (zSize / 2), ySize,
color, adjOverlapEast, skyLightTop, blockLight);
}
}
}
private static void makeAdjQuads(LodQuadBuilder builder, LodDataView adjData, LodDirection direction, short x, short y,
private static void makeAdjQuads(LodQuadBuilder builder, LodDataView adjData, ELodDirection direction, short x, short y,
short z, short w0, short wy, int color, int overlapColor, byte upSkyLight, byte blockLight)
{
color = ColorUtil.applyShade(color, MC.getShade(direction));
@@ -22,7 +22,7 @@ package com.seibel.lod.core.objects.opengl;
import java.util.ConcurrentModificationException;
import com.seibel.lod.core.builders.lodBuilding.bufferBuilding.LodQuadBuilder;
import com.seibel.lod.core.enums.config.GpuUploadMethod;
import com.seibel.lod.core.enums.config.EGpuUploadMethod;
import com.seibel.lod.core.render.LodRenderProgram;
import com.seibel.lod.core.util.StatsMap;
@@ -66,7 +66,7 @@ public abstract class RenderBuffer implements AutoCloseable
/* Return false if current renderMethod is not suited for current builder
* This will auto close the object if returning false. */
final public boolean tryUploadBuffers(LodQuadBuilder builder, GpuUploadMethod uploadMethod) {
final public boolean tryUploadBuffers(LodQuadBuilder builder, EGpuUploadMethod uploadMethod) {
_lockThread(State.Uploading);
boolean successful = false;
try {
@@ -102,7 +102,7 @@ public abstract class RenderBuffer implements AutoCloseable
* If false, close call will be automatically triggered.
* If true, the object will be used (by first calling the swapBufferToFront())
* on tick render. */
protected abstract boolean uploadBuffers(LodQuadBuilder builder, GpuUploadMethod uploadMethod);
protected abstract boolean uploadBuffers(LodQuadBuilder builder, EGpuUploadMethod uploadMethod);
// ========== Called by render thread ==========
@@ -30,10 +30,10 @@ import com.seibel.lod.core.api.internal.ClientApi;
import com.seibel.lod.core.builders.lodBuilding.bufferBuilding.CubicLodTemplate;
import com.seibel.lod.core.builders.lodBuilding.LodBuilder;
import com.seibel.lod.core.builders.lodBuilding.bufferBuilding.LodQuadBuilder;
import com.seibel.lod.core.enums.LodDirection;
import com.seibel.lod.core.enums.config.GpuUploadMethod;
import com.seibel.lod.core.enums.rendering.DebugMode;
import com.seibel.lod.core.enums.rendering.GLProxyContext;
import com.seibel.lod.core.enums.ELodDirection;
import com.seibel.lod.core.enums.config.EGpuUploadMethod;
import com.seibel.lod.core.enums.rendering.EDebugMode;
import com.seibel.lod.core.enums.rendering.EGLProxyContext;
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
import com.seibel.lod.core.objects.DHBlockPos;
import com.seibel.lod.core.objects.BoolType;
@@ -174,7 +174,7 @@ public class RenderRegion implements AutoCloseable
LodRegion[] adjRegions = new LodRegion[4];
try {
if (renderBufferBack != null) renderBufferBack.onReuse();
for (LodDirection dir : LodDirection.ADJ_DIRECTIONS) {
for (ELodDirection dir : ELodDirection.ADJ_DIRECTIONS) {
adjRegions[dir.ordinal() - 2] = lodDim.getRegion(regionPos.x+dir.getNormal().x, regionPos.z+dir.getNormal().z);
}
} catch (Throwable t) {
@@ -212,9 +212,9 @@ public class RenderRegion implements AutoCloseable
try {
EVENT_LOGGER.trace("RenderRegion start Upload @ {}", regionPos);
GLProxy glProxy = GLProxy.getInstance();
GpuUploadMethod method = GLProxy.getInstance().getGpuUploadMethod();
GLProxyContext oldContext = glProxy.getGlContext();
glProxy.setGlContext(GLProxyContext.LOD_BUILDER);
EGpuUploadMethod method = GLProxy.getInstance().getGpuUploadMethod();
EGLProxyContext oldContext = glProxy.getGlContext();
glProxy.setGlContext(EGLProxyContext.LOD_BUILDER);
try {
if (renderBufferBack == null) recreateBuffer(builder);
if (!renderBufferBack.tryUploadBuffers(builder, method)) {
@@ -257,7 +257,7 @@ public class RenderRegion implements AutoCloseable
byte minDetail = region.getMinDetailLevel();
// Variable initialization
DebugMode debugMode = CONFIG.client().advanced().debugging().getDebugMode();
EDebugMode debugMode = CONFIG.client().advanced().debugging().getDebugMode();
// We ask the lod dimension which block we have to render given the player
// position
@@ -308,7 +308,7 @@ public class RenderRegion implements AutoCloseable
// We avoid cases where the adjPosition is in player chunk while the position is
// not
// to always have a wall underwater
for (LodDirection lodDirection : LodDirection.ADJ_DIRECTIONS) {
for (ELodDirection lodDirection : ELodDirection.ADJ_DIRECTIONS) {
try {
int xAdj = posX + lodDirection.getNormal().x;
int zAdj = posZ + lodDirection.getNormal().z;
@@ -359,8 +359,8 @@ public class RenderRegion implements AutoCloseable
adjData[lodDirection.ordinal() - 2][0] = adjRegion.getDataView(adjDetail,
childXAdj, childZAdj);
adjData[lodDirection.ordinal() - 2][1] = adjRegion.getDataView(adjDetail,
childXAdj + (lodDirection.getAxis()==LodDirection.Axis.X ? 0 : 1),
childZAdj + (lodDirection.getAxis()==LodDirection.Axis.Z ? 0 : 1));
childXAdj + (lodDirection.getAxis()== ELodDirection.Axis.X ? 0 : 1),
childZAdj + (lodDirection.getAxis()== ELodDirection.Axis.Z ? 0 : 1));
}
} catch (RuntimeException e) {
EVENT_LOGGER.warn("Failed to get adj data for [{}:{},{}] at [{}]", detailLevel, posX, posZ, lodDirection);
@@ -25,7 +25,6 @@ import java.util.Iterator;
import java.util.concurrent.TimeUnit;
import com.seibel.lod.core.api.internal.ClientApi;
import com.seibel.lod.core.api.internal.InternalApiShared;
import com.seibel.lod.core.builders.lodBuilding.bufferBuilding.LodQuadBuilder;
import com.seibel.lod.core.logging.DhLoggerBuilder;
import com.seibel.lod.core.render.LodRenderer;
@@ -34,7 +33,7 @@ import org.apache.logging.log4j.Logger;
import org.lwjgl.opengl.GL32;
import com.seibel.lod.core.builders.lodBuilding.bufferBuilding.LodBufferBuilderFactory;
import com.seibel.lod.core.enums.config.GpuUploadMethod;
import com.seibel.lod.core.enums.config.EGpuUploadMethod;
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
import com.seibel.lod.core.builders.lodBuilding.bufferBuilding.LodQuadBuilder.BufferFiller;
import com.seibel.lod.core.render.GLProxy;
@@ -60,7 +59,7 @@ public class SimpleRenderBuffer extends RenderBuffer
}
@Override
protected boolean uploadBuffers(LodQuadBuilder builder, GpuUploadMethod method)
protected boolean uploadBuffers(LodQuadBuilder builder, EGpuUploadMethod method)
{
// if (builder.getCurrentNeededVertexBuffers()>6) return false;
@@ -121,7 +120,7 @@ public class SimpleRenderBuffer extends RenderBuffer
});
}
private void _uploadBuffersDirect(LodQuadBuilder builder, GpuUploadMethod method) {
private void _uploadBuffersDirect(LodQuadBuilder builder, EGpuUploadMethod method) {
resize(builder.getCurrentNeededVertexBufferCount());
long remainingNS = 0;
long BPerNS = CONFIG.client().advanced().buffers().getGpuUploadPerMegabyteInMilliseconds();
@@ -162,7 +161,7 @@ public class SimpleRenderBuffer extends RenderBuffer
}
}
private void _uploadBuffersMapped(LodQuadBuilder builder, GpuUploadMethod method)
private void _uploadBuffersMapped(LodQuadBuilder builder, EGpuUploadMethod method)
{
resize(builder.getCurrentNeededVertexBufferCount());
for (int i=0; i<vbos.length; i++) {
@@ -39,8 +39,8 @@ import org.lwjgl.opengl.GLUtil;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.seibel.lod.core.ModInfo;
import com.seibel.lod.core.enums.config.GpuUploadMethod;
import com.seibel.lod.core.enums.rendering.GLProxyContext;
import com.seibel.lod.core.enums.config.EGpuUploadMethod;
import com.seibel.lod.core.enums.rendering.EGLProxyContext;
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
import com.seibel.lod.core.util.GLMessage;
import com.seibel.lod.core.util.GLMessageOutputStream;
@@ -98,7 +98,7 @@ public class GLProxy
public boolean bufferStorageSupported = false; // ~OpenGL 4.4
public boolean VertexAttributeBufferBindingSupported = false; // ~OpenGL 4.3
private final GpuUploadMethod preferredUploadMethod;
private final EGpuUploadMethod preferredUploadMethod;
public final GLMessage.Builder vanillaDebugMessageBuilder;
public final GLMessage.Builder lodBuilderDebugMessageBuilder;
@@ -295,7 +295,7 @@ public class GLProxy
// get any GPU related capabilities //
//==================================//
setGlContext(GLProxyContext.LOD_BUILDER);
setGlContext(EGLProxyContext.LOD_BUILDER);
GLUtil.setupDebugMessageCallback(new PrintStream(new GLMessageOutputStream(GLProxy::logMessage, lodBuilderDebugMessageBuilder), true));
@@ -313,17 +313,17 @@ public class GLProxy
if (vendor.contains("NVIDIA") || vendor.contains("GEFORCE"))
{
// NVIDIA card
preferredUploadMethod = bufferStorageSupported ? GpuUploadMethod.BUFFER_STORAGE : GpuUploadMethod.SUB_DATA;
preferredUploadMethod = bufferStorageSupported ? EGpuUploadMethod.BUFFER_STORAGE : EGpuUploadMethod.SUB_DATA;
}
else
{
// AMD or Intel card
preferredUploadMethod = GpuUploadMethod.BUFFER_MAPPING;
preferredUploadMethod = EGpuUploadMethod.BUFFER_MAPPING;
}
GL_LOGGER.info("GPU Vendor [" + vendor + "], Preferred upload method is [" + preferredUploadMethod + "].");
setGlContext(GLProxyContext.PROXY_WORKER);
setGlContext(EGLProxyContext.PROXY_WORKER);
GLUtil.setupDebugMessageCallback(new PrintStream(new GLMessageOutputStream(GLProxy::logMessage, proxyWorkerDebugMessageBuilder), true));
@@ -332,7 +332,7 @@ public class GLProxy
//==========//
// Since this is created on the render thread, make sure the Minecraft context is used in the end
setGlContext(GLProxyContext.MINECRAFT);
setGlContext(EGLProxyContext.MINECRAFT);
// GLProxy creation success
GL_LOGGER.info(GLProxy.class.getSimpleName() + " creation successful. OpenGL smiles upon you this day.");
@@ -342,9 +342,9 @@ public class GLProxy
* A wrapper function to make switching contexts easier. <br>
* Does nothing if the calling thread is already using newContext.
*/
public void setGlContext(GLProxyContext newContext)
public void setGlContext(EGLProxyContext newContext)
{
GLProxyContext currentContext = getGlContext();
EGLProxyContext currentContext = getGlContext();
// we don't have to change the context, we are already there.
if (currentContext == newContext)
@@ -383,19 +383,19 @@ public class GLProxy
}
/** Returns this thread's OpenGL context. */
public GLProxyContext getGlContext()
public EGLProxyContext getGlContext()
{
long currentContext = GLFW.glfwGetCurrentContext();
if (currentContext == lodBuilderGlContext)
return GLProxyContext.LOD_BUILDER;
return EGLProxyContext.LOD_BUILDER;
else if (currentContext == minecraftGlContext)
return GLProxyContext.MINECRAFT;
return EGLProxyContext.MINECRAFT;
else if (currentContext == proxyWorkerGlContext)
return GLProxyContext.PROXY_WORKER;
return EGLProxyContext.PROXY_WORKER;
else if (currentContext == 0L)
return GLProxyContext.NONE;
return EGLProxyContext.NONE;
else
// hopefully this shouldn't happen
throw new IllegalStateException(Thread.currentThread().getName() +
@@ -417,17 +417,17 @@ public class GLProxy
return instance;
}
public GpuUploadMethod getGpuUploadMethod() {
GpuUploadMethod method = CONFIG.client().advanced().buffers().getGpuUploadMethod();
public EGpuUploadMethod getGpuUploadMethod() {
EGpuUploadMethod method = CONFIG.client().advanced().buffers().getGpuUploadMethod();
if (!bufferStorageSupported && method == GpuUploadMethod.BUFFER_STORAGE)
if (!bufferStorageSupported && method == EGpuUploadMethod.BUFFER_STORAGE)
{
// if buffer storage isn't supported
// default to SUB_DATA
method = GpuUploadMethod.SUB_DATA;
method = EGpuUploadMethod.SUB_DATA;
}
return method == GpuUploadMethod.AUTO ? preferredUploadMethod : method;
return method == EGpuUploadMethod.AUTO ? preferredUploadMethod : method;
}
/**
@@ -446,7 +446,7 @@ public class GLProxy
try
{
// set up the context...
setGlContext(GLProxyContext.PROXY_WORKER);
setGlContext(EGLProxyContext.PROXY_WORKER);
// ...run the actual code...
renderCall.run();
}
@@ -459,7 +459,7 @@ public class GLProxy
finally
{
// ...and make sure the context is released when the thread finishes
setGlContext(GLProxyContext.NONE);
setGlContext(EGLProxyContext.NONE);
}
}
@@ -19,8 +19,8 @@
package com.seibel.lod.core.render;
import com.seibel.lod.core.enums.rendering.FogDrawMode;
import com.seibel.lod.core.enums.rendering.FogDistance;
import com.seibel.lod.core.enums.rendering.EFogDrawMode;
import com.seibel.lod.core.enums.rendering.EFogDistance;
import com.seibel.lod.core.enums.rendering.*;
import com.seibel.lod.core.handlers.IReflectionHandler;
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
@@ -49,10 +49,10 @@ public class LodFogConfig
public static final boolean DEBUG_DUMP_GENERATED_CODE = false;
public final FogSetting farFogSetting;
public final FogSetting heightFogSetting;
public final HeightFogMixMode heightFogMixMode;
public final HeightFogMode heightFogMode;
public final EFogSetting farFogSetting;
public final EFogSetting heightFogSetting;
public final EHeightFogMixMode heightFogMixMode;
public final EHeightFogMode heightFogMode;
public final float heightFogHeight;
final boolean drawNearFog;
@@ -62,33 +62,33 @@ public class LodFogConfig
public static LodFogConfig generateFogConfig()
{
FogDrawMode fogMode = CONFIG.client().graphics().fogQuality().getFogDrawMode();
if (fogMode == FogDrawMode.USE_OPTIFINE_SETTING)
EFogDrawMode fogMode = CONFIG.client().graphics().fogQuality().getFogDrawMode();
if (fogMode == EFogDrawMode.USE_OPTIFINE_SETTING)
fogMode = REFLECTION_HANDLER.getFogDrawMode();
return new LodFogConfig(fogMode);
}
/** sets all fog options from the config */
private LodFogConfig(FogDrawMode fogDrawMode)
private LodFogConfig(EFogDrawMode fogDrawMode)
{
earthCurveRatio = CONFIG.client().graphics().advancedGraphics().getEarthCurveRatio(); //FIXME: Move this out of here
if (fogDrawMode != FogDrawMode.FOG_DISABLED)
if (fogDrawMode != EFogDrawMode.FOG_DISABLED)
{
ILodConfigWrapperSingleton.IClient.IGraphics.IFogQuality fogSettings = CONFIG.client().graphics().fogQuality();
FogDistance fogDistance = fogSettings.getFogDistance();
drawNearFog = (fogDistance == FogDistance.NEAR || fogDistance == FogDistance.NEAR_AND_FAR);
EFogDistance fogDistance = fogSettings.getFogDistance();
drawNearFog = (fogDistance == EFogDistance.NEAR || fogDistance == EFogDistance.NEAR_AND_FAR);
if (fogDistance == FogDistance.FAR || fogDistance == FogDistance.NEAR_AND_FAR)
if (fogDistance == EFogDistance.FAR || fogDistance == EFogDistance.NEAR_AND_FAR)
{
// far fog should be drawn
farFogSetting = fogSettings.advancedFog().computeFarFogSetting();
heightFogMixMode = fogSettings.advancedFog().heightFog().getHeightFogMixMode();
if (heightFogMixMode == HeightFogMixMode.IGNORE_HEIGHT || heightFogMixMode == HeightFogMixMode.BASIC)
if (heightFogMixMode == EHeightFogMixMode.IGNORE_HEIGHT || heightFogMixMode == EHeightFogMixMode.BASIC)
{
// basic fog mixing
@@ -211,7 +211,7 @@ public class LodFogConfig
str.append("" +
"float calculateFarFogDepth(float horizontal, float dist, float nearFogStart) \n" +
"{ \n" +
" return " + (heightFogMixMode == HeightFogMixMode.BASIC ?
" return " + (heightFogMixMode == EHeightFogMixMode.BASIC ?
"(dist - nearFogStart)/(1.0 - nearFogStart);" :
"(horizontal - nearFogStart)/(1.0 - nearFogStart);") +
"} \n");
@@ -238,8 +238,8 @@ public class LodFogConfig
str.append("// =======RUNTIME GENERATED DEFINE SECTION======== //\n");
str.append("#version 150 core\n");
FogSetting activeFarFogSetting = this.farFogSetting != null ? this.farFogSetting : FogSetting.EMPTY;
FogSetting activeHeightFogSetting = this.heightFogSetting != null ? this.heightFogSetting : FogSetting.EMPTY;
EFogSetting activeFarFogSetting = this.farFogSetting != null ? this.farFogSetting : EFogSetting.EMPTY;
EFogSetting activeHeightFogSetting = this.heightFogSetting != null ? this.heightFogSetting : EFogSetting.EMPTY;
str.append("\n" +
"#define farFogStart " + activeFarFogSetting.start + "\n" +
@@ -259,7 +259,7 @@ public class LodFogConfig
return str;
}
private static String getFarFogMethod(FogSetting.FogType fogType)
private static String getFarFogMethod(EFogSetting.FogType fogType)
{
switch (fogType)
{
@@ -275,7 +275,7 @@ public class LodFogConfig
}
}
private static String getHeightDepthMethod(HeightFogMode heightMode, float heightFogHeight)
private static String getHeightDepthMethod(EHeightFogMode heightMode, float heightFogHeight)
{
String str = "";
if (!heightMode.basedOnCamera)
@@ -307,7 +307,7 @@ public class LodFogConfig
* Example: <br>
* <code>" return linearFog(dist, heightFogStart, heightFogLength, heightFogMin, heightFogRange);"</code>
*/
private static String getHeightFogMethod(FogSetting.FogType fogType)
private static String getHeightFogMethod(EFogSetting.FogType fogType)
{
switch (fogType)
{
@@ -327,7 +327,7 @@ public class LodFogConfig
* creates a line in the format <br>
* <code>" return max(1.0-near, far);" </code>
*/
private static String getMixFogLine(HeightFogMixMode heightFogMode, boolean drawNearFog)
private static String getMixFogLine(EHeightFogMixMode heightFogMode, boolean drawNearFog)
{
String str = " return ";
@@ -38,9 +38,9 @@ import org.apache.logging.log4j.LogManager;
import org.lwjgl.opengl.GL32;
import com.seibel.lod.core.builders.lodBuilding.bufferBuilding.LodBufferBuilderFactory;
import com.seibel.lod.core.enums.rendering.DebugMode;
import com.seibel.lod.core.enums.rendering.FogColorMode;
import com.seibel.lod.core.enums.rendering.FogDistance;
import com.seibel.lod.core.enums.rendering.EDebugMode;
import com.seibel.lod.core.enums.rendering.EFogColorMode;
import com.seibel.lod.core.enums.rendering.EFogDistance;
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
import com.seibel.lod.core.objects.lod.LodDimension;
import com.seibel.lod.core.objects.math.Mat4f;
@@ -95,7 +95,7 @@ public class LodRenderer
* If true the LODs colors will be replaced with
* a checkerboard, this can be used for debugging.
*/
public DebugMode previousDebugMode = DebugMode.OFF;
public EDebugMode previousDebugMode = EDebugMode.OFF;
// This tells us if the renderer is enabled or not. If in a world, it should be enabled.
private boolean isSetupComplete = false;
@@ -118,7 +118,7 @@ public class LodRenderer
/** This is used to determine if the LODs should be regenerated */
private FogDistance prevFogDistance = FogDistance.NEAR_AND_FAR;
private EFogDistance prevFogDistance = EFogDistance.NEAR_AND_FAR;
/**
* if this is true the LOD buffers should be regenerated,
@@ -248,10 +248,10 @@ public class LodRenderer
drawBindBuff.end("drawBindBuff");
// set the required open GL settings
LagSpikeCatcher drawSetPolygon = new LagSpikeCatcher();
if (CONFIG.client().advanced().debugging().getDebugMode() == DebugMode.SHOW_DETAIL_WIREFRAME
|| CONFIG.client().advanced().debugging().getDebugMode() == DebugMode.SHOW_GENMODE_WIREFRAME
|| CONFIG.client().advanced().debugging().getDebugMode() == DebugMode.SHOW_WIREFRAME
|| CONFIG.client().advanced().debugging().getDebugMode() == DebugMode.SHOW_OVERLAPPING_QUADS_WIREFRAME) {
if (CONFIG.client().advanced().debugging().getDebugMode() == EDebugMode.SHOW_DETAIL_WIREFRAME
|| CONFIG.client().advanced().debugging().getDebugMode() == EDebugMode.SHOW_GENMODE_WIREFRAME
|| CONFIG.client().advanced().debugging().getDebugMode() == EDebugMode.SHOW_WIREFRAME
|| CONFIG.client().advanced().debugging().getDebugMode() == EDebugMode.SHOW_OVERLAPPING_QUADS_WIREFRAME) {
GL32.glPolygonMode(GL32.GL_FRONT_AND_BACK, GL32.GL_LINE);
//GL32.glDisable(GL32.GL_CULL_FACE);
}
@@ -432,7 +432,7 @@ public class LodRenderer
{
Color fogColor;
if (CONFIG.client().graphics().fogQuality().getFogColorMode() == FogColorMode.USE_SKY_COLOR)
if (CONFIG.client().graphics().fogQuality().getFogColorMode() == EFogColorMode.USE_SKY_COLOR)
fogColor = MC_RENDER.getSkyColor();
else
fogColor = MC_RENDER.getFogColor(partialTicks);
@@ -19,8 +19,8 @@
package com.seibel.lod.core.render;
import com.seibel.lod.core.enums.config.GpuUploadMethod;
import com.seibel.lod.core.enums.config.LoggerMode;
import com.seibel.lod.core.enums.config.EGpuUploadMethod;
import com.seibel.lod.core.enums.config.ELoggerMode;
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
import com.seibel.lod.core.logging.ConfigBasedLogger;
@@ -42,9 +42,9 @@ public class RenderSystemTest {
public RenderSystemTest() {}
public static final ConfigBasedLogger logger = new ConfigBasedLogger(
LogManager.getLogger(RenderSystemTest.class), () -> LoggerMode.LOG_ALL_TO_CHAT);
LogManager.getLogger(RenderSystemTest.class), () -> ELoggerMode.LOG_ALL_TO_CHAT);
public static final ConfigBasedSpamLogger spamLogger = new ConfigBasedSpamLogger(
LogManager.getLogger(RenderSystemTest.class), () -> LoggerMode.LOG_ALL_TO_CHAT, 1);
LogManager.getLogger(RenderSystemTest.class), () -> ELoggerMode.LOG_ALL_TO_CHAT, 1);
private static final IMinecraftRenderWrapper MC_RENDER = SingletonHandler.get(IMinecraftRenderWrapper.class);
ShaderProgram basicShader;
@@ -86,7 +86,7 @@ public class RenderSystemTest {
buffer.rewind();
GLVertexBuffer vbo = new GLVertexBuffer(false);
vbo.bind();
vbo.uploadBuffer(buffer, 4, GpuUploadMethod.DATA, vertices.length * Float.BYTES);
vbo.uploadBuffer(buffer, 4, EGpuUploadMethod.DATA, vertices.length * Float.BYTES);
return vbo;
}
@@ -22,8 +22,8 @@ package com.seibel.lod.core.render;
import com.seibel.lod.core.config.Config;
import com.seibel.lod.core.builders.lodBuilding.bufferBuilding.LodBufferBuilderFactory;
import com.seibel.lod.core.config.types.ConfigEntry;
import com.seibel.lod.core.enums.rendering.DebugMode;
import com.seibel.lod.core.enums.rendering.FogColorMode;
import com.seibel.lod.core.enums.rendering.EDebugMode;
import com.seibel.lod.core.enums.rendering.EFogColorMode;
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
import com.seibel.lod.core.logging.ConfigBasedLogger;
import com.seibel.lod.core.logging.ConfigBasedSpamLogger;
@@ -81,7 +81,7 @@ public class a7LodRenderer
private static final IMinecraftClientWrapper MC = SingletonHandler.get(IMinecraftClientWrapper.class);
private static final IMinecraftRenderWrapper MC_RENDER = SingletonHandler.get(IMinecraftRenderWrapper.class);
public DebugMode previousDebugMode = null;
public EDebugMode previousDebugMode = null;
public final DHLevel level;
// The shader program
@@ -140,11 +140,11 @@ public class a7LodRenderer
GL32.glViewport(0,0, MC_RENDER.getTargetFrameBufferViewportWidth(), MC_RENDER.getTargetFrameBufferViewportHeight());
GL32.glBindBuffer(GL32.GL_ARRAY_BUFFER, 0);
// set the required open GL settings
ConfigEntry<DebugMode> debugModeConfig = Config.Client.Advanced.Debugging.debugMode;
if (debugModeConfig.get() == DebugMode.SHOW_DETAIL_WIREFRAME
|| debugModeConfig.get() == DebugMode.SHOW_GENMODE_WIREFRAME
|| debugModeConfig.get() == DebugMode.SHOW_WIREFRAME
|| debugModeConfig.get() == DebugMode.SHOW_OVERLAPPING_QUADS_WIREFRAME) {
ConfigEntry<EDebugMode> debugModeConfig = Config.Client.Advanced.Debugging.debugMode;
if (debugModeConfig.get() == EDebugMode.SHOW_DETAIL_WIREFRAME
|| debugModeConfig.get() == EDebugMode.SHOW_GENMODE_WIREFRAME
|| debugModeConfig.get() == EDebugMode.SHOW_WIREFRAME
|| debugModeConfig.get() == EDebugMode.SHOW_OVERLAPPING_QUADS_WIREFRAME) {
GL32.glPolygonMode(GL32.GL_FRONT_AND_BACK, GL32.GL_LINE);
//GL32.glDisable(GL32.GL_CULL_FACE);
}
@@ -276,7 +276,7 @@ public class a7LodRenderer
{
Color fogColor;
if (Config.Client.Graphics.FogQuality.fogColorMode.get() == FogColorMode.USE_SKY_COLOR)
if (Config.Client.Graphics.FogQuality.fogColorMode.get() == EFogColorMode.USE_SKY_COLOR)
fogColor = MC_RENDER.getSkyColor();
else
fogColor = MC_RENDER.getFogColor(partialTicks);
@@ -1,8 +1,7 @@
package com.seibel.lod.core.render.objects;
import com.seibel.lod.core.api.internal.InternalApiShared;
import com.seibel.lod.core.enums.config.GpuUploadMethod;
import com.seibel.lod.core.enums.rendering.GLProxyContext;
import com.seibel.lod.core.enums.config.EGpuUploadMethod;
import com.seibel.lod.core.enums.rendering.EGLProxyContext;
import com.seibel.lod.core.logging.DhLoggerBuilder;
import com.seibel.lod.core.render.GLProxy;
import com.seibel.lod.core.util.UnitBytes;
@@ -56,7 +55,7 @@ public class GLBuffer implements AutoCloseable
}
protected void create(boolean asBufferStorage) {
if (GLProxy.getInstance().getGlContext() == GLProxyContext.NONE)
if (GLProxy.getInstance().getGlContext() == EGLProxyContext.NONE)
throw new IllegalStateException("Thread [" +Thread.currentThread().getName() + "] tried to create a GLBuffer outside a OpenGL context.");
this.id = GL32.glGenBuffers();
this.bufferStorage = asBufferStorage;
@@ -70,7 +69,7 @@ public class GLBuffer implements AutoCloseable
//ApiShared.LOGGER.warn("Buffer double close! First close call stack: {}", Arrays.toString(firstCloseCallStack));
throw new IllegalStateException("Buffer double close!");
}
if (async && GLProxy.getInstance().getGlContext() != GLProxyContext.PROXY_WORKER) {
if (async && GLProxy.getInstance().getGlContext() != EGLProxyContext.PROXY_WORKER) {
GLProxy.getInstance().recordOpenGlCall(() -> destroy((false)));
} else {
GL32.glDeleteBuffers(id);
@@ -115,7 +114,7 @@ public class GLBuffer implements AutoCloseable
}
// Requires already binded
public void uploadBuffer(ByteBuffer bb, GpuUploadMethod uploadMethod, int maxExpansionSize, int bufferHint) {
public void uploadBuffer(ByteBuffer bb, EGpuUploadMethod uploadMethod, int maxExpansionSize, int bufferHint) {
if (uploadMethod.useEarlyMapping)
throw new IllegalArgumentException("UploadMethod signal that this should use Mapping instead of uploadBuffer!");
int bbSize = bb.limit()-bb.position();
@@ -147,7 +146,7 @@ public class GLBuffer implements AutoCloseable
}
}
public ByteBuffer mapBuffer(int targetSize, GpuUploadMethod uploadMethod, int maxExpensionSize, int bufferHint, int mapFlags) {
public ByteBuffer mapBuffer(int targetSize, EGpuUploadMethod uploadMethod, int maxExpensionSize, int bufferHint, int mapFlags) {
if (targetSize == 0) throw new IllegalArgumentException("MapBuffer targetSize is 0!");
if (!uploadMethod.useEarlyMapping) throw new IllegalStateException("Upload method must be one that use mappings in order to call mapBuffer!");
if (isMapped) throw new IllegalStateException("Map Buffer called but buffer is already mapped!");
@@ -19,11 +19,8 @@
package com.seibel.lod.core.render.objects;
import com.seibel.lod.core.enums.config.GpuUploadMethod;
import org.lwjgl.opengl.GL32;
import java.nio.ByteBuffer;
/**
* This is a container for a OpenGL
* VBO (Vertex Buffer Object).
@@ -22,7 +22,7 @@ package com.seibel.lod.core.render.objects;
import java.nio.ByteBuffer;
import org.lwjgl.opengl.GL32;
import com.seibel.lod.core.enums.config.GpuUploadMethod;
import com.seibel.lod.core.enums.config.EGpuUploadMethod;
/**
* This is a container for a OpenGL
@@ -58,7 +58,7 @@ public class GLVertexBuffer extends GLBuffer
return GL32.GL_ARRAY_BUFFER;
}
public void uploadBuffer(ByteBuffer bb, int vertCount, GpuUploadMethod uploadMethod, int maxExpensionSize) {
public void uploadBuffer(ByteBuffer bb, int vertCount, EGpuUploadMethod uploadMethod, int maxExpensionSize) {
if (vertCount < 0) throw new IllegalArgumentException("VertCount is negative!");
// If size is zero, just ignore it.
if (bb.limit()-bb.position() != 0) {
@@ -68,7 +68,7 @@ public class GLVertexBuffer extends GLBuffer
vertexCount = vertCount;
}
public ByteBuffer mapBuffer(int targetSize, GpuUploadMethod uploadMethod, int maxExpensionSize)
public ByteBuffer mapBuffer(int targetSize, EGpuUploadMethod uploadMethod, int maxExpensionSize)
{
return super.mapBuffer(targetSize, uploadMethod, maxExpensionSize,
uploadMethod.useBufferStorage ? GL32.GL_MAP_WRITE_BIT :
@@ -1,7 +1,6 @@
package com.seibel.lod.core.render.objects;
import com.seibel.lod.core.api.internal.InternalApiShared;
import com.seibel.lod.core.enums.config.GpuUploadMethod;
import com.seibel.lod.core.enums.config.EGpuUploadMethod;
import com.seibel.lod.core.logging.DhLoggerBuilder;
import com.seibel.lod.core.render.GLProxy;
import org.apache.logging.log4j.Logger;
@@ -119,11 +118,11 @@ public class QuadElementBuffer extends GLElementBuffer
if (!gl.bufferStorageSupported) {
bind();
super.uploadBuffer(buffer, GpuUploadMethod.DATA,
super.uploadBuffer(buffer, EGpuUploadMethod.DATA,
indicesCount * GLEnums.getTypeSize(type), GL32.GL_STATIC_DRAW);
} else {
bind();
super.uploadBuffer(buffer, GpuUploadMethod.BUFFER_STORAGE,
super.uploadBuffer(buffer, EGpuUploadMethod.BUFFER_STORAGE,
indicesCount * GLEnums.getTypeSize(type), 0);
}
}
@@ -19,7 +19,7 @@
package com.seibel.lod.core.util;
import com.seibel.lod.core.enums.config.HorizontalQuality;
import com.seibel.lod.core.enums.config.EHorizontalQuality;
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton;
@@ -57,7 +57,7 @@ public class DetailDistanceUtil
detail-=minDetail;
if (CONFIG.client().graphics().quality().getHorizontalQuality() == HorizontalQuality.LOWEST)
if (CONFIG.client().graphics().quality().getHorizontalQuality() == EHorizontalQuality.LOWEST)
return ((double)detail * distanceUnit);
else
{
@@ -81,7 +81,7 @@ public class DetailDistanceUtil
int detail;
if (CONFIG.client().graphics().quality().getHorizontalQuality() == HorizontalQuality.LOWEST)
if (CONFIG.client().graphics().quality().getHorizontalQuality() == EHorizontalQuality.LOWEST)
detail = (int) (distance/distanceUnit);
else
detail = (int) (Math.log(distance/distanceUnit) / logBase);
@@ -24,8 +24,8 @@ import java.util.Iterator;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import com.seibel.lod.core.enums.config.ServerFolderNameMode;
import com.seibel.lod.core.enums.config.VanillaOverdraw;
import com.seibel.lod.core.enums.config.EServerFolderNameMode;
import com.seibel.lod.core.enums.config.EVanillaOverdraw;
import com.seibel.lod.core.handlers.IReflectionHandler;
import com.seibel.lod.core.handlers.dependencyInjection.SingletonHandler;
import com.seibel.lod.core.objects.DHChunkPos;
@@ -261,18 +261,18 @@ public class LodUtil
// determine the format of the folder name
ServerFolderNameMode folderNameMode = CONFIG.client().multiplayer().getServerFolderNameMode();
if (folderNameMode == ServerFolderNameMode.AUTO)
EServerFolderNameMode folderNameMode = CONFIG.client().multiplayer().getServerFolderNameMode();
if (folderNameMode == EServerFolderNameMode.AUTO)
{
if (parsedIp.isLan())
{
// LAN
folderNameMode = ServerFolderNameMode.NAME_IP;
folderNameMode = EServerFolderNameMode.NAME_IP;
}
else
{
// normal multiplayer
folderNameMode = ServerFolderNameMode.NAME_IP_PORT;
folderNameMode = EServerFolderNameMode.NAME_IP_PORT;
}
}
@@ -350,10 +350,10 @@ public class LodUtil
public static int computeOverdrawOffset(LodDimension lodDim) {
int chunkRenderDist = MC_RENDER.getRenderDistance() + 1;
VanillaOverdraw overdraw = CONFIG.client().graphics().advancedGraphics().getVanillaOverdraw();
if (overdraw == VanillaOverdraw.ALWAYS) return Integer.MAX_VALUE;
EVanillaOverdraw overdraw = CONFIG.client().graphics().advancedGraphics().getVanillaOverdraw();
if (overdraw == EVanillaOverdraw.ALWAYS) return Integer.MAX_VALUE;
int offset;
if (overdraw == VanillaOverdraw.NEVER) {
if (overdraw == EVanillaOverdraw.NEVER) {
offset = CONFIG.client().graphics().advancedGraphics().getOverdrawOffset();
} else {
if (chunkRenderDist < MINIMUM_RENDER_DISTANCE_FOR_FAR_OVERDRAW) {
@@ -19,7 +19,6 @@
package com.seibel.lod.core.wrapperInterfaces;
import com.seibel.lod.core.enums.config.DistanceGenerationMode;
import com.seibel.lod.core.handlers.dependencyInjection.IBindable;
/**
@@ -19,8 +19,8 @@
package com.seibel.lod.core.wrapperInterfaces.block;
import com.seibel.lod.core.enums.LodDirection;
import com.seibel.lod.core.enums.config.BlocksToAvoid;
import com.seibel.lod.core.enums.ELodDirection;
import com.seibel.lod.core.enums.config.EBlocksToAvoid;
import com.seibel.lod.core.objects.DHBlockPos;
import com.seibel.lod.core.wrapperInterfaces.chunk.IChunkWrapper;
@@ -30,8 +30,8 @@ public abstract class IBlockDetailWrapper
// Note: ALL value should be lazily-calculated
// Note: This should be lazily-calculated if block needs tinting to be resolved
public abstract int getAndResolveFaceColor(LodDirection dir, IChunkWrapper chunk, DHBlockPos blockPos);
public abstract boolean hasFaceCullingFor(LodDirection dir);
public abstract int getAndResolveFaceColor(ELodDirection dir, IChunkWrapper chunk, DHBlockPos blockPos);
public abstract boolean hasFaceCullingFor(ELodDirection dir);
public abstract boolean hasNoCollision();
public abstract boolean noFaceIsFullFace();
@@ -50,7 +50,7 @@ public abstract class IBlockDetailWrapper
return serialize();
}
public boolean shouldRender(BlocksToAvoid mode)
public boolean shouldRender(EBlocksToAvoid mode)
{
return !((mode.noCollision && hasNoCollision()) || (mode.nonFull && noFaceIsFullFace()));
}
@@ -19,7 +19,7 @@
package com.seibel.lod.core.wrapperInterfaces.chunk;
import com.seibel.lod.core.enums.LodDirection;
import com.seibel.lod.core.enums.ELodDirection;
import com.seibel.lod.core.handlers.dependencyInjection.IBindable;
import com.seibel.lod.core.util.LodUtil;
import com.seibel.lod.core.wrapperInterfaces.block.IBlockDetailWrapper;
@@ -44,7 +44,7 @@ public interface IChunkWrapper extends IBindable
IBlockDetailWrapper getBlockDetail(int x, int y, int z);
// Returns null if block doesn't exist. Note that this can cross chunk boundaries.
IBlockDetailWrapper getBlockDetailAtFace(int x, int y, int z, LodDirection dir);
IBlockDetailWrapper getBlockDetailAtFace(int x, int y, int z, ELodDirection dir);
@Deprecated
int getChunkPosX();
@@ -19,10 +19,10 @@
package com.seibel.lod.core.wrapperInterfaces.config;
import com.seibel.lod.core.enums.rendering.FogDrawMode;
import com.seibel.lod.core.enums.rendering.FogColorMode;
import com.seibel.lod.core.enums.rendering.FogDistance;
import com.seibel.lod.core.enums.rendering.RendererType;
import com.seibel.lod.core.enums.rendering.EFogDrawMode;
import com.seibel.lod.core.enums.rendering.EFogColorMode;
import com.seibel.lod.core.enums.rendering.EFogDistance;
import com.seibel.lod.core.enums.rendering.ERendererType;
import com.seibel.lod.core.enums.config.*;
import com.seibel.lod.core.enums.rendering.*;
import com.seibel.lod.core.handlers.dependencyInjection.IBindable;
@@ -62,28 +62,28 @@ public interface ILodConfigWrapperSingleton extends IBindable
@Deprecated
interface IQuality
{
HorizontalResolution getDrawResolution();
void setDrawResolution(HorizontalResolution newHorizontalResolution);
EHorizontalResolution getDrawResolution();
void setDrawResolution(EHorizontalResolution newHorizontalResolution);
int getLodChunkRenderDistance();
void setLodChunkRenderDistance(int newLodChunkRenderDistance);
VerticalQuality getVerticalQuality();
void setVerticalQuality(VerticalQuality newVerticalQuality);
EVerticalQuality getVerticalQuality();
void setVerticalQuality(EVerticalQuality newVerticalQuality);
int getHorizontalScale();
void setHorizontalScale(int newHorizontalScale);
HorizontalQuality getHorizontalQuality();
void setHorizontalQuality(HorizontalQuality newHorizontalQuality);
EHorizontalQuality getHorizontalQuality();
void setHorizontalQuality(EHorizontalQuality newHorizontalQuality);
DropoffQuality getDropoffQuality();
void setDropoffQuality(DropoffQuality newDropoffQuality);
default DropoffQuality getResolvedDropoffQuality() {
DropoffQuality dropoffQuality = getDropoffQuality();
if (dropoffQuality == DropoffQuality.AUTO)
EDropoffQuality getDropoffQuality();
void setDropoffQuality(EDropoffQuality newDropoffQuality);
default EDropoffQuality getResolvedDropoffQuality() {
EDropoffQuality dropoffQuality = getDropoffQuality();
if (dropoffQuality == EDropoffQuality.AUTO)
dropoffQuality = getLodChunkRenderDistance() < 128 ?
DropoffQuality.SMOOTH_DROPOFF : DropoffQuality.PERFORMANCE_FOCUSED;
EDropoffQuality.SMOOTH_DROPOFF : EDropoffQuality.PERFORMANCE_FOCUSED;
return dropoffQuality;
}
@@ -93,14 +93,14 @@ public interface ILodConfigWrapperSingleton extends IBindable
@Deprecated
interface IFogQuality
{
FogDistance getFogDistance();
void setFogDistance(FogDistance newFogDistance);
EFogDistance getFogDistance();
void setFogDistance(EFogDistance newFogDistance);
FogDrawMode getFogDrawMode();
void setFogDrawMode(FogDrawMode newFogDrawMode);
EFogDrawMode getFogDrawMode();
void setFogDrawMode(EFogDrawMode newFogDrawMode);
FogColorMode getFogColorMode();
void setFogColorMode(FogColorMode newFogColorMode);
EFogColorMode getFogColorMode();
void setFogColorMode(EFogColorMode newFogColorMode);
boolean getDisableVanillaFog();
void setDisableVanillaFog(boolean newDisableVanillaFog);
@@ -120,8 +120,8 @@ public interface ILodConfigWrapperSingleton extends IBindable
double getFarFogMax();
void setFarFogMax(double newFarFogMax);
FogSetting.FogType getFarFogType();
void setFarFogType(FogSetting.FogType newFarFogType);
EFogSetting.FogType getFarFogType();
void setFarFogType(EFogSetting.FogType newFarFogType);
double getFarFogDensity();
void setFarFogDensity(double newFarFogDensity);
@@ -129,11 +129,11 @@ public interface ILodConfigWrapperSingleton extends IBindable
IHeightFog heightFog();
@Deprecated
interface IHeightFog {
HeightFogMixMode getHeightFogMixMode();
void setHeightFogMixMode(HeightFogMixMode newHeightFogMixMode);
EHeightFogMixMode getHeightFogMixMode();
void setHeightFogMixMode(EHeightFogMixMode newHeightFogMixMode);
HeightFogMode getHeightFogMode();
void setHeightFogMode(HeightFogMode newHeightFogMode);
EHeightFogMode getHeightFogMode();
void setHeightFogMode(EHeightFogMode newHeightFogMode);
double getHeightFogHeight();
void setHeightFogHeight(double newHeightFogHeight);
@@ -150,14 +150,14 @@ public interface ILodConfigWrapperSingleton extends IBindable
double getHeightFogMax();
void setHeightFogMax(double newHeightFogMax);
FogSetting.FogType getHeightFogType();
void setHeightFogType(FogSetting.FogType newFarFogType);
EFogSetting.FogType getHeightFogType();
void setHeightFogType(EFogSetting.FogType newFarFogType);
double getHeightFogDensity();
void setHeightFogDensity(double newHeightFogDensity);
default FogSetting computeHeightFogSetting() {
return new FogSetting(
default EFogSetting computeHeightFogSetting() {
return new EFogSetting(
getHeightFogStart(),
getHeightFogEnd(),
getHeightFogMin(),
@@ -167,8 +167,8 @@ public interface ILodConfigWrapperSingleton extends IBindable
);
}
}
default FogSetting computeFarFogSetting() {
return new FogSetting(
default EFogSetting computeFarFogSetting() {
return new EFogSetting(
getFarFogStart(),
getFarFogEnd(),
getFarFogMin(),
@@ -185,8 +185,8 @@ public interface ILodConfigWrapperSingleton extends IBindable
boolean getDisableDirectionalCulling();
void setDisableDirectionalCulling(boolean newDisableDirectionalCulling);
VanillaOverdraw getVanillaOverdraw();
void setVanillaOverdraw(VanillaOverdraw newVanillaOverdraw);
EVanillaOverdraw getVanillaOverdraw();
void setVanillaOverdraw(EVanillaOverdraw newVanillaOverdraw);
int getOverdrawOffset();
void setOverdrawOffset(int newOverdrawOffset);
@@ -231,8 +231,8 @@ public interface ILodConfigWrapperSingleton extends IBindable
@Deprecated
interface IMultiplayer
{
ServerFolderNameMode getServerFolderNameMode();
void setServerFolderNameMode(ServerFolderNameMode newServerFolderNameMode);
EServerFolderNameMode getServerFolderNameMode();
void setServerFolderNameMode(EServerFolderNameMode newServerFolderNameMode);
double getMultiDimensionRequiredSimilarity();
void setMultiDimensionRequiredSimilarity(double newMultiDimensionMinimumSimilarityPercent);
@@ -251,25 +251,25 @@ public interface ILodConfigWrapperSingleton extends IBindable
boolean getEnableDistantGeneration();
void setEnableDistantGeneration(boolean newEnableDistantGeneration);
DistanceGenerationMode getDistanceGenerationMode();
void setDistanceGenerationMode(DistanceGenerationMode newDistanceGenerationMode);
EDistanceGenerationMode getDistanceGenerationMode();
void setDistanceGenerationMode(EDistanceGenerationMode newDistanceGenerationMode);
LightGenerationMode getLightGenerationMode();
void setLightGenerationMode(LightGenerationMode newLightGenerationMode);
ELightGenerationMode getLightGenerationMode();
void setLightGenerationMode(ELightGenerationMode newLightGenerationMode);
GenerationPriority getGenerationPriority();
void setGenerationPriority(GenerationPriority newGenerationPriority);
EGenerationPriority getGenerationPriority();
void setGenerationPriority(EGenerationPriority newGenerationPriority);
default GenerationPriority getResolvedGenerationPriority() {
GenerationPriority priority = getGenerationPriority();
default EGenerationPriority getResolvedGenerationPriority() {
EGenerationPriority priority = getGenerationPriority();
IMinecraftClientWrapper MC = SingletonHandler.get(IMinecraftClientWrapper.class);
if (priority == GenerationPriority.AUTO)
priority = MC.hasSinglePlayerServer() ? GenerationPriority.FAR_FIRST : GenerationPriority.BALANCED;
if (priority == EGenerationPriority.AUTO)
priority = MC.hasSinglePlayerServer() ? EGenerationPriority.FAR_FIRST : EGenerationPriority.BALANCED;
return priority;
}
BlocksToAvoid getBlocksToAvoid();
void setBlockToAvoid(BlocksToAvoid newBlockToAvoid);
EBlocksToAvoid getBlocksToAvoid();
void setBlockToAvoid(EBlocksToAvoid newBlockToAvoid);
Boolean getTintWithAvoidedBlocks();
void setTintWithAvoidedBlocks(Boolean shouldTint);
@@ -309,11 +309,11 @@ public interface ILodConfigWrapperSingleton extends IBindable
@Deprecated
interface IDebugging
{
RendererType getRendererType();
void setRendererType(RendererType newRendererType);
ERendererType getRendererType();
void setRendererType(ERendererType newRendererType);
DebugMode getDebugMode();
void setDebugMode(DebugMode newDebugMode);
EDebugMode getDebugMode();
void setDebugMode(EDebugMode newDebugMode);
boolean getDebugKeybindingsEnabled();
void setDebugKeybindingsEnabled(boolean newEnableDebugKeybindings);
@@ -335,45 +335,45 @@ public interface ILodConfigWrapperSingleton extends IBindable
* NetworkEvent //NOT IMPL YET
*/
LoggerMode getLogWorldGenEvent();
void setLogWorldGenEvent(LoggerMode newLogWorldGenEvent);
ELoggerMode getLogWorldGenEvent();
void setLogWorldGenEvent(ELoggerMode newLogWorldGenEvent);
LoggerMode getLogWorldGenPerformance();
void setLogWorldGenPerformance(LoggerMode newLogWorldGenPerformance);
ELoggerMode getLogWorldGenPerformance();
void setLogWorldGenPerformance(ELoggerMode newLogWorldGenPerformance);
LoggerMode getLogWorldGenLoadEvent();
void setLogWorldGenLoadEvent(LoggerMode newLogWorldGenLoadEvent);
ELoggerMode getLogWorldGenLoadEvent();
void setLogWorldGenLoadEvent(ELoggerMode newLogWorldGenLoadEvent);
LoggerMode getLogLodBuilderEvent();
void setLogLodBuilderEvent(LoggerMode newLogLodBuilderEvent);
ELoggerMode getLogLodBuilderEvent();
void setLogLodBuilderEvent(ELoggerMode newLogLodBuilderEvent);
LoggerMode getLogRendererBufferEvent();
void setLogRendererBufferEvent(LoggerMode newLogRendererBufferEvent);
ELoggerMode getLogRendererBufferEvent();
void setLogRendererBufferEvent(ELoggerMode newLogRendererBufferEvent);
LoggerMode getLogRendererGLEvent();
void setLogRendererGLEvent(LoggerMode newLogRendererGLEvent);
ELoggerMode getLogRendererGLEvent();
void setLogRendererGLEvent(ELoggerMode newLogRendererGLEvent);
LoggerMode getLogFileReadWriteEvent();
void setLogFileReadWriteEvent(LoggerMode newLogFileReadWriteEvent);
ELoggerMode getLogFileReadWriteEvent();
void setLogFileReadWriteEvent(ELoggerMode newLogFileReadWriteEvent);
LoggerMode getLogFileSubDimEvent();
void setLogFileSubDimEvent(LoggerMode newLogFileSubDimEvent);
ELoggerMode getLogFileSubDimEvent();
void setLogFileSubDimEvent(ELoggerMode newLogFileSubDimEvent);
LoggerMode getLogNetworkEvent();
void setLogNetworkEvent(LoggerMode newLogNetworkEvent);
ELoggerMode getLogNetworkEvent();
void setLogNetworkEvent(ELoggerMode newLogNetworkEvent);
}
}
@Deprecated
interface IBuffers
{
GpuUploadMethod getGpuUploadMethod();
void setGpuUploadMethod(GpuUploadMethod newGpuUploadMethod);
EGpuUploadMethod getGpuUploadMethod();
void setGpuUploadMethod(EGpuUploadMethod newGpuUploadMethod);
int getGpuUploadPerMegabyteInMilliseconds();
void setGpuUploadPerMegabyteInMilliseconds(int newMilliseconds);
BufferRebuildTimes getRebuildTimes();
void setRebuildTimes(BufferRebuildTimes newBufferRebuildTimes);
EBufferRebuildTimes getRebuildTimes();
void setRebuildTimes(EBufferRebuildTimes newBufferRebuildTimes);
}
boolean getLodOnlyMode();
@@ -1,9 +1,9 @@
package com.seibel.lod.core.wrapperInterfaces.config;
import com.seibel.lod.core.enums.rendering.FogDrawMode;
import com.seibel.lod.core.enums.rendering.FogColorMode;
import com.seibel.lod.core.enums.rendering.FogDistance;
import com.seibel.lod.core.enums.rendering.RendererType;
import com.seibel.lod.core.enums.rendering.EFogDrawMode;
import com.seibel.lod.core.enums.rendering.EFogColorMode;
import com.seibel.lod.core.enums.rendering.EFogDistance;
import com.seibel.lod.core.enums.rendering.ERendererType;
import com.seibel.lod.core.config.Config;
import com.seibel.lod.core.enums.config.*;
import com.seibel.lod.core.enums.rendering.*;
@@ -121,12 +121,12 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
public static class Quality implements IQuality
{
@Override
public HorizontalResolution getDrawResolution()
public EHorizontalResolution getDrawResolution()
{
return Config.Client.Graphics.Quality.drawResolution.get();
}
@Override
public void setDrawResolution(HorizontalResolution newHorizontalResolution)
public void setDrawResolution(EHorizontalResolution newHorizontalResolution)
{
Config.Client.Graphics.Quality.drawResolution.set(newHorizontalResolution);
}
@@ -145,12 +145,12 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
@Override
public VerticalQuality getVerticalQuality()
public EVerticalQuality getVerticalQuality()
{
return Config.Client.Graphics.Quality.verticalQuality.get();
}
@Override
public void setVerticalQuality(VerticalQuality newVerticalQuality)
public void setVerticalQuality(EVerticalQuality newVerticalQuality)
{
Config.Client.Graphics.Quality.verticalQuality.set(newVerticalQuality);
}
@@ -169,22 +169,22 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
@Override
public HorizontalQuality getHorizontalQuality()
public EHorizontalQuality getHorizontalQuality()
{
return Config.Client.Graphics.Quality.horizontalQuality.get();
}
@Override
public void setHorizontalQuality(HorizontalQuality newHorizontalQuality)
public void setHorizontalQuality(EHorizontalQuality newHorizontalQuality)
{
Config.Client.Graphics.Quality.horizontalQuality.set(newHorizontalQuality);
}
@Override
public DropoffQuality getDropoffQuality() {
public EDropoffQuality getDropoffQuality() {
return Config.Client.Graphics.Quality.dropoffQuality.get();
}
@Override
public void setDropoffQuality(DropoffQuality newDropoffQuality) {
public void setDropoffQuality(EDropoffQuality newDropoffQuality) {
Config.Client.Graphics.Quality.dropoffQuality.set(newDropoffQuality);
}
@@ -210,38 +210,38 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
}
@Override
public FogDistance getFogDistance()
public EFogDistance getFogDistance()
{
return Config.Client.Graphics.FogQuality.fogDistance.get();
}
@Override
public void setFogDistance(FogDistance newFogDistance)
public void setFogDistance(EFogDistance newFogDistance)
{
Config.Client.Graphics.FogQuality.fogDistance.set(newFogDistance);
}
@Override
public FogDrawMode getFogDrawMode()
public EFogDrawMode getFogDrawMode()
{
return Config.Client.Graphics.FogQuality.fogDrawMode.get();
}
@Override
public void setFogDrawMode(FogDrawMode setFogDrawMode)
public void setFogDrawMode(EFogDrawMode setFogDrawMode)
{
Config.Client.Graphics.FogQuality.fogDrawMode.set(setFogDrawMode);
}
@Override
public FogColorMode getFogColorMode()
public EFogColorMode getFogColorMode()
{
return Config.Client.Graphics.FogQuality.fogColorMode.get();
}
@Override
public void setFogColorMode(FogColorMode newFogColorMode)
public void setFogColorMode(EFogColorMode newFogColorMode)
{
Config.Client.Graphics.FogQuality.fogColorMode.set(newFogColorMode);
}
@@ -287,7 +287,7 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
return Config.Client.Graphics.FogQuality.AdvancedFog.farFogMax.get();
}
@Override
public FogSetting.FogType getFarFogType() {
public EFogSetting.FogType getFarFogType() {
return Config.Client.Graphics.FogQuality.AdvancedFog.farFogType.get();
}
@Override
@@ -312,7 +312,7 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
Config.Client.Graphics.FogQuality.AdvancedFog.farFogMax.set(newFarFogMax);
}
@Override
public void setFarFogType(FogSetting.FogType newFarFogType) {
public void setFarFogType(EFogSetting.FogType newFarFogType) {
Config.Client.Graphics.FogQuality.AdvancedFog.farFogType.set(newFarFogType);
}
@Override
@@ -328,11 +328,11 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
public static class HeightFog implements IHeightFog {
@Override
public HeightFogMixMode getHeightFogMixMode() {
public EHeightFogMixMode getHeightFogMixMode() {
return Config.Client.Graphics.FogQuality.AdvancedFog.HeightFog.heightFogMixMode.get();
}
@Override
public HeightFogMode getHeightFogMode() {
public EHeightFogMode getHeightFogMode() {
return Config.Client.Graphics.FogQuality.AdvancedFog.HeightFog.heightFogMode.get();
}
@Override
@@ -356,7 +356,7 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
return Config.Client.Graphics.FogQuality.AdvancedFog.HeightFog.heightFogMax.get();
}
@Override
public FogSetting.FogType getHeightFogType() {
public EFogSetting.FogType getHeightFogType() {
return Config.Client.Graphics.FogQuality.AdvancedFog.HeightFog.heightFogType.get();
}
@Override
@@ -365,11 +365,11 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
}
@Override
public void setHeightFogMixMode(HeightFogMixMode newHeightFogMixMode) {
public void setHeightFogMixMode(EHeightFogMixMode newHeightFogMixMode) {
Config.Client.Graphics.FogQuality.AdvancedFog.HeightFog.heightFogMixMode.set(newHeightFogMixMode);
}
@Override
public void setHeightFogMode(HeightFogMode newHeightFogMode) {
public void setHeightFogMode(EHeightFogMode newHeightFogMode) {
Config.Client.Graphics.FogQuality.AdvancedFog.HeightFog.heightFogMode.set(newHeightFogMode);
}
@Override
@@ -393,7 +393,7 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
Config.Client.Graphics.FogQuality.AdvancedFog.HeightFog.heightFogMax.set(newHeightFogMax);
}
@Override
public void setHeightFogType(FogSetting.FogType newHeightFogType) {
public void setHeightFogType(EFogSetting.FogType newHeightFogType) {
Config.Client.Graphics.FogQuality.AdvancedFog.HeightFog.heightFogType.set(newHeightFogType);
}
@Override
@@ -421,12 +421,12 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
@Override
public VanillaOverdraw getVanillaOverdraw()
public EVanillaOverdraw getVanillaOverdraw()
{
return Config.Client.Graphics.AdvancedGraphics.vanillaOverdraw.get();
}
@Override
public void setVanillaOverdraw(VanillaOverdraw newVanillaOverdraw)
public void setVanillaOverdraw(EVanillaOverdraw newVanillaOverdraw)
{
Config.Client.Graphics.AdvancedGraphics.vanillaOverdraw.set(newVanillaOverdraw);
}
@@ -531,24 +531,24 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
public static class WorldGenerator implements IWorldGenerator
{
@Override
public GenerationPriority getGenerationPriority()
public EGenerationPriority getGenerationPriority()
{
return Config.Client.WorldGenerator.generationPriority.get();
}
@Override
public void setGenerationPriority(GenerationPriority newGenerationPriority)
public void setGenerationPriority(EGenerationPriority newGenerationPriority)
{
Config.Client.WorldGenerator.generationPriority.set(newGenerationPriority);
}
@Override
public DistanceGenerationMode getDistanceGenerationMode()
public EDistanceGenerationMode getDistanceGenerationMode()
{
return Config.Client.WorldGenerator.distanceGenerationMode.get();
}
@Override
public void setDistanceGenerationMode(DistanceGenerationMode newDistanceGenerationMode)
public void setDistanceGenerationMode(EDistanceGenerationMode newDistanceGenerationMode)
{
Config.Client.WorldGenerator.distanceGenerationMode.set(newDistanceGenerationMode);
}
@@ -568,12 +568,12 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
@Override
public BlocksToAvoid getBlocksToAvoid()
public EBlocksToAvoid getBlocksToAvoid()
{
return Config.Client.WorldGenerator.blocksToAvoid.get();
}
@Override
public void setBlockToAvoid(BlocksToAvoid newBlockToAvoid)
public void setBlockToAvoid(EBlocksToAvoid newBlockToAvoid)
{
Config.Client.WorldGenerator.blocksToAvoid.set(newBlockToAvoid);
}
@@ -599,12 +599,12 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
Config.Client.WorldGenerator.enableDistantGeneration.set(newEnableDistantGeneration);
}
@Override
public LightGenerationMode getLightGenerationMode()
public ELightGenerationMode getLightGenerationMode()
{
return Config.Client.WorldGenerator.lightGenerationMode.get();
}
@Override
public void setLightGenerationMode(LightGenerationMode newLightGenerationMode)
public void setLightGenerationMode(ELightGenerationMode newLightGenerationMode)
{
Config.Client.WorldGenerator.lightGenerationMode.set(newLightGenerationMode);
}
@@ -618,12 +618,12 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
public static class Multiplayer implements IMultiplayer
{
@Override
public ServerFolderNameMode getServerFolderNameMode()
public EServerFolderNameMode getServerFolderNameMode()
{
return Config.Client.Multiplayer.serverFolderNameMode.get();
}
@Override
public void setServerFolderNameMode(ServerFolderNameMode newServerFolderNameMode)
public void setServerFolderNameMode(EServerFolderNameMode newServerFolderNameMode)
{
Config.Client.Multiplayer.serverFolderNameMode.set(newServerFolderNameMode);
}
@@ -729,21 +729,21 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
* DISABLED
* */
@Override
public RendererType getRendererType() {
public ERendererType getRendererType() {
return Config.Client.Advanced.Debugging.rendererType.get();
}
@Override
public void setRendererType(RendererType newRenderType) {
public void setRendererType(ERendererType newRenderType) {
Config.Client.Advanced.Debugging.rendererType.set(newRenderType);
}
@Override
public DebugMode getDebugMode()
public EDebugMode getDebugMode()
{
return Config.Client.Advanced.Debugging.debugMode.get();
}
@Override
public void setDebugMode(DebugMode newDebugMode)
public void setDebugMode(EDebugMode newDebugMode)
{
Config.Client.Advanced.Debugging.debugMode.set(newDebugMode);
}
@@ -780,83 +780,83 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
*/
@Override
public LoggerMode getLogWorldGenEvent() {
public ELoggerMode getLogWorldGenEvent() {
return Config.Client.Advanced.Debugging.DebugSwitch.logWorldGenEvent.get();
}
@Override
public void setLogWorldGenEvent(LoggerMode newLogWorldGenEvent) {
public void setLogWorldGenEvent(ELoggerMode newLogWorldGenEvent) {
Config.Client.Advanced.Debugging.DebugSwitch.logWorldGenEvent.set(newLogWorldGenEvent);
}
@Override
public LoggerMode getLogWorldGenPerformance() {
public ELoggerMode getLogWorldGenPerformance() {
return Config.Client.Advanced.Debugging.DebugSwitch.logWorldGenPerformance.get();
}
@Override
public void setLogWorldGenPerformance(LoggerMode newLogWorldGenPerformance) {
public void setLogWorldGenPerformance(ELoggerMode newLogWorldGenPerformance) {
Config.Client.Advanced.Debugging.DebugSwitch.logWorldGenPerformance.set(newLogWorldGenPerformance);
}
@Override
public LoggerMode getLogWorldGenLoadEvent() {
public ELoggerMode getLogWorldGenLoadEvent() {
return Config.Client.Advanced.Debugging.DebugSwitch.logWorldGenLoadEvent.get();
}
@Override
public void setLogWorldGenLoadEvent(LoggerMode newLogWorldGenLoadEvent) {
public void setLogWorldGenLoadEvent(ELoggerMode newLogWorldGenLoadEvent) {
Config.Client.Advanced.Debugging.DebugSwitch.logWorldGenLoadEvent.set(newLogWorldGenLoadEvent);
}
@Override
public LoggerMode getLogLodBuilderEvent() {
public ELoggerMode getLogLodBuilderEvent() {
return Config.Client.Advanced.Debugging.DebugSwitch.logLodBuilderEvent.get();
}
@Override
public void setLogLodBuilderEvent(LoggerMode newLogLodBuilderEvent) {
public void setLogLodBuilderEvent(ELoggerMode newLogLodBuilderEvent) {
Config.Client.Advanced.Debugging.DebugSwitch.logLodBuilderEvent.set(newLogLodBuilderEvent);
}
@Override
public LoggerMode getLogRendererBufferEvent() {
public ELoggerMode getLogRendererBufferEvent() {
return Config.Client.Advanced.Debugging.DebugSwitch.logRendererBufferEvent.get();
}
@Override
public void setLogRendererBufferEvent(LoggerMode newLogRendererBufferEvent) {
public void setLogRendererBufferEvent(ELoggerMode newLogRendererBufferEvent) {
Config.Client.Advanced.Debugging.DebugSwitch.logRendererBufferEvent.set(newLogRendererBufferEvent);
}
@Override
public LoggerMode getLogRendererGLEvent() {
public ELoggerMode getLogRendererGLEvent() {
return Config.Client.Advanced.Debugging.DebugSwitch.logRendererGLEvent.get();
}
@Override
public void setLogRendererGLEvent(LoggerMode newLogRendererGLEvent) {
public void setLogRendererGLEvent(ELoggerMode newLogRendererGLEvent) {
Config.Client.Advanced.Debugging.DebugSwitch.logRendererGLEvent.set(newLogRendererGLEvent);
}
@Override
public LoggerMode getLogFileReadWriteEvent() {
public ELoggerMode getLogFileReadWriteEvent() {
return Config.Client.Advanced.Debugging.DebugSwitch.logFileReadWriteEvent.get();
}
@Override
public void setLogFileReadWriteEvent(LoggerMode newLogFileReadWriteEvent) {
public void setLogFileReadWriteEvent(ELoggerMode newLogFileReadWriteEvent) {
Config.Client.Advanced.Debugging.DebugSwitch.logFileReadWriteEvent.set(newLogFileReadWriteEvent);
}
@Override
public LoggerMode getLogFileSubDimEvent() {
public ELoggerMode getLogFileSubDimEvent() {
return Config.Client.Advanced.Debugging.DebugSwitch.logFileSubDimEvent.get();
}
@Override
public void setLogFileSubDimEvent(LoggerMode newLogFileSubDimEvent) {
public void setLogFileSubDimEvent(ELoggerMode newLogFileSubDimEvent) {
Config.Client.Advanced.Debugging.DebugSwitch.logFileSubDimEvent.set(newLogFileSubDimEvent);
}
@Override
public LoggerMode getLogNetworkEvent() {
public ELoggerMode getLogNetworkEvent() {
return Config.Client.Advanced.Debugging.DebugSwitch.logNetworkEvent.get();
}
@Override
public void setLogNetworkEvent(LoggerMode newLogNetworkEvent) {
public void setLogNetworkEvent(ELoggerMode newLogNetworkEvent) {
Config.Client.Advanced.Debugging.DebugSwitch.logNetworkEvent.set(newLogNetworkEvent);
}
}
@@ -867,12 +867,12 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
{
@Override
public GpuUploadMethod getGpuUploadMethod()
public EGpuUploadMethod getGpuUploadMethod()
{
return Config.Client.Advanced.Buffers.gpuUploadMethod.get();
}
@Override
public void setGpuUploadMethod(GpuUploadMethod newDisableVanillaFog)
public void setGpuUploadMethod(EGpuUploadMethod newDisableVanillaFog)
{
Config.Client.Advanced.Buffers.gpuUploadMethod.set(newDisableVanillaFog);
}
@@ -890,12 +890,12 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
@Override
public BufferRebuildTimes getRebuildTimes()
public EBufferRebuildTimes getRebuildTimes()
{
return Config.Client.Advanced.Buffers.rebuildTimes.get();
}
@Override
public void setRebuildTimes(BufferRebuildTimes newBufferRebuildTimes)
public void setRebuildTimes(EBufferRebuildTimes newBufferRebuildTimes)
{
Config.Client.Advanced.Buffers.rebuildTimes.set(newBufferRebuildTimes);
}
@@ -22,7 +22,7 @@ package com.seibel.lod.core.wrapperInterfaces.minecraft;
import java.io.File;
import java.util.ArrayList;
import com.seibel.lod.core.enums.LodDirection;
import com.seibel.lod.core.enums.ELodDirection;
import com.seibel.lod.core.handlers.dependencyInjection.IBindable;
import com.seibel.lod.core.objects.DHBlockPos;
import com.seibel.lod.core.objects.DHChunkPos;
@@ -57,7 +57,7 @@ public interface IMinecraftClientWrapper extends IBindable
// method wrappers //
//=================//
float getShade(LodDirection lodDirection);
float getShade(ELodDirection lodDirection);
boolean hasSinglePlayerServer();
@@ -21,7 +21,7 @@ package com.seibel.lod.core.wrapperInterfaces.world;
import java.io.File;
import com.seibel.lod.core.enums.WorldType;
import com.seibel.lod.core.enums.EWorldType;
import com.seibel.lod.core.handlers.dependencyInjection.IBindable;
import com.seibel.lod.core.objects.DHChunkPos;
import com.seibel.lod.core.wrapperInterfaces.chunk.IChunkWrapper;
@@ -36,7 +36,7 @@ public interface IWorldWrapper extends IBindable
{
IDimensionTypeWrapper getDimensionType();
WorldType getWorldType();
EWorldType getWorldType();
int getBlockLight(int x, int y, int z);
+5 -5
View File
@@ -18,9 +18,9 @@
*/
import com.seibel.lod.core.api.external.apiObjects.enums.DhApiEnumAssembly;
import com.seibel.lod.core.enums.rendering.FogDrawMode;
import com.seibel.lod.core.enums.rendering.EFogDrawMode;
import com.seibel.lod.core.enums.CoreEnumAssembly;
import com.seibel.lod.core.enums.config.VerticalQuality;
import com.seibel.lod.core.enums.config.EVerticalQuality;
import com.seibel.lod.core.util.EnumUtil;
import org.junit.Test;
import org.junit.Assert;
@@ -54,9 +54,9 @@ public class ApiEnumSyncTests
//=================//
// this should always succeed (comparing an enum to itself)
AssertEnumsValuesAreEqual(EnumUtil.compareEnumClassesByValues(VerticalQuality.class, VerticalQuality.class), true);
AssertEnumsValuesAreEqual(EnumUtil.compareEnumClassesByValues(EVerticalQuality.class, EVerticalQuality.class), true);
// this should always fail (two completely different enums)
AssertEnumsValuesAreEqual(EnumUtil.compareEnumClassesByValues(VerticalQuality.class, FogDrawMode.class), false);
AssertEnumsValuesAreEqual(EnumUtil.compareEnumClassesByValues(EVerticalQuality.class, EFogDrawMode.class), false);
@@ -93,7 +93,7 @@ public class ApiEnumSyncTests
// compare each API enum to its corresponding Core enum
for (Class<? extends Enum<?>> apiEnumClass : apiEnumClassList)
{
String coreEnumName = apiEnumClass.getSimpleName().substring(DhApiEnumAssembly.API_ENUM_PREFIX.length());
String coreEnumName = CoreEnumAssembly.ENUM_PREFIX + apiEnumClass.getSimpleName().substring(DhApiEnumAssembly.API_ENUM_PREFIX.length());
boolean coreEnumFound = false;
// find the core enum to compare against