diff --git a/api/src/main/java/com/seibel/lod/api/items/interfaces/config/both/IDhApiWorldGeneration.java b/api/src/main/java/com/seibel/lod/api/items/interfaces/config/both/IDhApiWorldGenerationConfig.java similarity index 97% rename from api/src/main/java/com/seibel/lod/api/items/interfaces/config/both/IDhApiWorldGeneration.java rename to api/src/main/java/com/seibel/lod/api/items/interfaces/config/both/IDhApiWorldGenerationConfig.java index b8e8020dc..52921b1b7 100644 --- a/api/src/main/java/com/seibel/lod/api/items/interfaces/config/both/IDhApiWorldGeneration.java +++ b/api/src/main/java/com/seibel/lod/api/items/interfaces/config/both/IDhApiWorldGenerationConfig.java @@ -31,9 +31,9 @@ import com.seibel.lod.api.items.interfaces.config.IDhApiConfig; * Note: Fake chunks are NOT saved in Minecraft's vanilla save system. * * @author James Seibel - * @version 2022-7-11 + * @version 2022-9-15 */ -public interface IDhApiWorldGeneration +public interface IDhApiWorldGenerationConfig { /** diff --git a/api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiBuffers.java b/api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiBuffersConfig.java similarity index 96% rename from api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiBuffers.java rename to api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiBuffersConfig.java index d3bdcfb2c..1042129a7 100644 --- a/api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiBuffers.java +++ b/api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiBuffersConfig.java @@ -26,9 +26,9 @@ import com.seibel.lod.api.items.interfaces.config.IDhApiConfig; * Distant Horizons' OpenGL buffer configuration. * * @author James Seibel - * @version 2022-7-5 + * @version 2022-9-15 */ -public interface IDhApiBuffers +public interface IDhApiBuffersConfig { /** Defines how geometry data is uploaded to the GPU. */ diff --git a/api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiDebugging.java b/api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiDebuggingConfig.java similarity index 95% rename from api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiDebugging.java rename to api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiDebuggingConfig.java index db21aaa4d..518963eb1 100644 --- a/api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiDebugging.java +++ b/api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiDebuggingConfig.java @@ -26,9 +26,9 @@ import com.seibel.lod.api.items.interfaces.config.IDhApiConfig; * Distant Horizons' debug configuration. * * @author James Seibel - * @version 2022-7-5 + * @version 2022-9-15 */ -public interface IDhApiDebugging +public interface IDhApiDebuggingConfig { /** Can be used to debug the standard fake chunk rendering. */ IDhApiConfig getDebugRenderModeConfig(); diff --git a/api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiGraphics.java b/api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiGraphicsConfig.java similarity index 92% rename from api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiGraphics.java rename to api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiGraphicsConfig.java index a86153652..9cc2d6d09 100644 --- a/api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiGraphics.java +++ b/api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiGraphicsConfig.java @@ -27,9 +27,9 @@ import com.seibel.lod.api.items.interfaces.config.IDhApiConfig; * Distant Horizons' graphics/rendering configuration. * * @author James Seibel - * @version 2022-7-11 + * @version 2022-9-15 */ -public interface IDhApiGraphics +public interface IDhApiGraphicsConfig { //========================// @@ -40,10 +40,10 @@ public interface IDhApiGraphics IDhApiConfig getChunkRenderDistanceConfig(); /** - * Simplified version of {@link IDhApiGraphics#getRenderingModeConfig()} + * Simplified version of {@link IDhApiGraphicsConfig#getRenderingModeConfig()} * that only enables/disables the fake chunk rendering.

* - * Changing this config also changes {@link IDhApiGraphics#getRenderingModeConfig()}'s value. + * Changing this config also changes {@link IDhApiGraphicsConfig#getRenderingModeConfig()}'s value. */ IDhApiConfig getRenderingEnabledConfig(); @@ -53,7 +53,7 @@ public interface IDhApiGraphics * The debug renderer is used to confirm rendering is working at and will draw * a single multicolor rhombus on the screen in skybox space (AKA behind MC's rendering).

* - * Changing this config also changes {@link IDhApiGraphics#getRenderingEnabledConfig()}'s value. + * Changing this config also changes {@link IDhApiGraphicsConfig#getRenderingEnabledConfig()}'s value. */ IDhApiConfig getRenderingModeConfig(); diff --git a/api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiGraphicsFog.java b/api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiGraphicsFogConfig.java similarity index 96% rename from api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiGraphicsFog.java rename to api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiGraphicsFogConfig.java index e0eb9d909..b9559fb9c 100644 --- a/api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiGraphicsFog.java +++ b/api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiGraphicsFogConfig.java @@ -21,6 +21,7 @@ package com.seibel.lod.api.items.interfaces.config.client; import com.seibel.lod.api.items.enums.rendering.*; import com.seibel.lod.api.items.interfaces.config.IDhApiConfig; +import com.seibel.lod.api.items.objects.config.DhApiConfig; /** * Distant Horizons' fog configuration.

@@ -30,9 +31,9 @@ import com.seibel.lod.api.items.interfaces.config.IDhApiConfig; * these settings will only affect Distant horizons' fog. * * @author James Seibel - * @version 2022-7-11 + * @version 2022-9-15 */ -public interface IDhApiGraphicsFog +public interface IDhApiGraphicsFogConfig { //====================// @@ -103,7 +104,7 @@ public interface IDhApiGraphicsFog IDhApiConfig getHeightFogModeConfig(); /** - * Defines the height fog's base height if {@link IDhApiGraphicsFog#getHeightFogModeConfig()} + * Defines the height fog's base height if {@link IDhApiGraphicsFogConfig#getHeightFogModeConfig()} * is set to use a specific height. */ IDhApiConfig getHeightFogBaseHeightConfig(); @@ -126,5 +127,4 @@ public interface IDhApiGraphicsFog /** Defines the height fog's density. */ IDhApiConfig getHeightFogDensityConfig(); - } diff --git a/api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiMultiplayer.java b/api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiMultiplayerConfig.java similarity index 96% rename from api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiMultiplayer.java rename to api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiMultiplayerConfig.java index 208df14af..bc52fe42b 100644 --- a/api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiMultiplayer.java +++ b/api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiMultiplayerConfig.java @@ -26,9 +26,9 @@ import com.seibel.lod.api.items.interfaces.config.IDhApiConfig; * Distant Horizons' client-side multiplayer configuration. * * @author James Seibel - * @version 2022-7-5 + * @version 2022-9-15 */ -public interface IDhApiMultiplayer +public interface IDhApiMultiplayerConfig { /** diff --git a/api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiThreading.java b/api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiThreadingConfig.java similarity index 97% rename from api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiThreading.java rename to api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiThreadingConfig.java index de13b2a99..d92ac4c6f 100644 --- a/api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiThreading.java +++ b/api/src/main/java/com/seibel/lod/api/items/interfaces/config/client/IDhApiThreadingConfig.java @@ -25,9 +25,9 @@ import com.seibel.lod.api.items.interfaces.config.IDhApiConfig; * Distant Horizons' threading configuration. * * @author James Seibel - * @version 2022-7-5 + * @version 2022-9-15 */ -public interface IDhApiThreading +public interface IDhApiThreadingConfig { /** diff --git a/api/src/main/java/com/seibel/lod/api/items/objects/config/DhApiConfig.java b/api/src/main/java/com/seibel/lod/api/items/objects/config/DhApiConfig.java index 8e3e61036..00ebf4b75 100644 --- a/api/src/main/java/com/seibel/lod/api/items/objects/config/DhApiConfig.java +++ b/api/src/main/java/com/seibel/lod/api/items/objects/config/DhApiConfig.java @@ -6,13 +6,15 @@ import com.seibel.lod.core.interfaces.config.IConverter; import com.seibel.lod.core.interfaces.config.converters.DefaultConverter; /** - * A wrapper used to interface with Distant Horizon's Config. + * A wrapper used to interface with Distant Horizon's Config.

* * When using this object you need to explicitly define the generic types, * otherwise Intellij won't do any type checking and the wrong types can be used.
* For example a method returning IDhApiConfig when the config should be a Boolean. * - * @param + * @param The datatype you, an API dev will use. + * @param The datatype Distant Horizons uses in the background; implementing developers can ignore this. + * * @author James Seibel * @version 2022-6-30 */ diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/Readme.md b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/Readme.md deleted file mode 100644 index c5c387723..000000000 --- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/Readme.md +++ /dev/null @@ -1,3 +0,0 @@ -The config api package holds objects and methods for getting/setting Distant Horizons' config values. - -The configs are split up into: client, server, and both; depending on whether they are relevant to client only use, server only use, or both client and server use. \ No newline at end of file diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/both/DhApiWorldGeneration.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/both/DhApiWorldGenerationConfig.java similarity index 69% rename from core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/both/DhApiWorldGeneration.java rename to core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/both/DhApiWorldGenerationConfig.java index 89eeafc32..6b10e3357 100644 --- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/both/DhApiWorldGeneration.java +++ b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/both/DhApiWorldGenerationConfig.java @@ -20,7 +20,7 @@ package com.seibel.lod.core.api.external.coreImplementations.methods.config.both; import com.seibel.lod.api.items.interfaces.config.IDhApiConfig; -import com.seibel.lod.api.items.interfaces.config.both.IDhApiWorldGeneration; +import com.seibel.lod.api.items.interfaces.config.both.IDhApiWorldGenerationConfig; import com.seibel.lod.api.items.objects.config.DhApiConfig; import com.seibel.lod.core.config.Config.Client.WorldGenerator; import com.seibel.lod.api.items.enums.config.EBlocksToAvoid; @@ -34,54 +34,32 @@ import com.seibel.lod.api.items.enums.config.ELightGenerationMode; * Note: Fake chunks are NOT saved in Minecraft's vanilla save system. * * @author James Seibel - * @version 2022-7-11 + * @version 2022-9-15 */ -public class DhApiWorldGeneration implements IDhApiWorldGeneration +public class DhApiWorldGenerationConfig implements IDhApiWorldGenerationConfig { - /** - * Defines whether fake chunks will be generated - * outside Minecraft's vanilla render distance. - */ @Override public IDhApiConfig getEnableDistantWorldGenerationConfig() { return new DhApiConfig<>(WorldGenerator.enableDistantGeneration); } - /** Defines to what level fake chunks will be generated. */ @Override public IDhApiConfig getDistantGeneratorDetailLevelConfig() { return new DhApiConfig<>(WorldGenerator.distanceGenerationMode); } - /** Defines how generated fake chunks will be lit. */ @Override public IDhApiConfig getLightingModeConfig() { return new DhApiConfig<>(WorldGenerator.lightGenerationMode); } - /** Defines the order in which fake chunks will be generated. */ @Override public IDhApiConfig getGenerationPriorityConfig() { return new DhApiConfig<>(WorldGenerator.generationPriority); } - /** - * Defines what blocks will be ignored when generating LODs. - * - * TODO if this isn't deprecated before 1.7 it should probably be moved to the graphics tab - * @deprecated this method won't be needed once we transition to an ID based save system
- * (vs the color based system we have currently) - */ @Deprecated @Override public IDhApiConfig getBlocksToAvoidConfig() { return new DhApiConfig<>(WorldGenerator.blocksToAvoid); } - /** - * Defines if the color of avoided blocks will color the block below them.
- * (IE: if flowers are avoided should they color the grass below them?) - * - * TODO if this isn't deprecated before 1.7 it should probably be moved to the graphics tab - * @deprecated this method won't be needed once we transition to an ID based save system
- * (vs the color based system we have currently) - */ @Deprecated @Override public IDhApiConfig getTintWithAvoidedBlocksConfig() diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiBuffers.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiBuffersConfig.java similarity index 71% rename from core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiBuffers.java rename to core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiBuffersConfig.java index 7d5180cfc..b91a689d7 100644 --- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiBuffers.java +++ b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiBuffersConfig.java @@ -20,6 +20,7 @@ package com.seibel.lod.core.api.external.coreImplementations.methods.config.client; import com.seibel.lod.api.items.interfaces.config.IDhApiConfig; +import com.seibel.lod.api.items.interfaces.config.client.IDhApiBuffersConfig; import com.seibel.lod.api.items.objects.config.DhApiConfig; import com.seibel.lod.core.config.Config.Client.Advanced.Buffers; import com.seibel.lod.api.items.enums.config.EGpuUploadMethod; @@ -28,23 +29,15 @@ import com.seibel.lod.api.items.enums.config.EGpuUploadMethod; * Distant Horizons' OpenGL buffer configuration. * * @author James Seibel - * @version 2022-7-5 + * @version 2022-9-15 */ -public class DhApiBuffers +public class DhApiBuffersConfig implements IDhApiBuffersConfig { - /** Defines how geometry data is uploaded to the GPU. */ - public static IDhApiConfig getGpuUploadMethodConfig() + public IDhApiConfig getGpuUploadMethodConfig() { return new DhApiConfig<>(Buffers.gpuUploadMethod); } - /** - * Defines how long we should wait after uploading one - * Megabyte of geometry data to the GPU before uploading - * the next Megabyte of data.
- * This can be set to a non-zero number to reduce stuttering caused by - * uploading buffers to the GPU. - */ - public static IDhApiConfig getBufferUploadTimeoutPerMegabyteInMillisecondsConfig() + public IDhApiConfig getBufferUploadTimeoutPerMegabyteInMillisecondsConfig() { return new DhApiConfig<>(Buffers.gpuUploadPerMegabyteInMilliseconds); } } diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiDebugging.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiDebuggingConfig.java similarity index 81% rename from core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiDebugging.java rename to core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiDebuggingConfig.java index eeda8a50c..56265d915 100644 --- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiDebugging.java +++ b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiDebuggingConfig.java @@ -20,6 +20,7 @@ package com.seibel.lod.core.api.external.coreImplementations.methods.config.client; import com.seibel.lod.api.items.interfaces.config.IDhApiConfig; +import com.seibel.lod.api.items.interfaces.config.client.IDhApiDebuggingConfig; import com.seibel.lod.api.items.objects.config.DhApiConfig; import com.seibel.lod.core.config.Config.Client.Advanced.Debugging; import com.seibel.lod.api.items.enums.rendering.EDebugMode; @@ -28,17 +29,15 @@ import com.seibel.lod.api.items.enums.rendering.EDebugMode; * Distant Horizons' debug configuration. * * @author James Seibel - * @version 2022-7-5 + * @version 2022-9-15 */ -public class DhApiDebugging +public class DhApiDebuggingConfig implements IDhApiDebuggingConfig { - /** Can be used to debug the standard fake chunk rendering. */ - public static IDhApiConfig getDebugRenderModeConfig() + + public IDhApiConfig getDebugRenderModeConfig() { return new DhApiConfig<>(Debugging.debugMode); } - /** If enabled debug keybindings can be used. */ - public static IDhApiConfig getEnableDebugKeybindingsConfig() + public IDhApiConfig getEnableDebugKeybindingsConfig() { return new DhApiConfig<>(Debugging.enableDebugKeybindings); } - } diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiGraphics.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiGraphics.java deleted file mode 100644 index 3ce63f986..000000000 --- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiGraphics.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * This file is part of the Distant Horizons mod (formerly the LOD Mod), - * licensed under the GNU LGPL v3 License. - * - * Copyright (C) 2020-2022 James Seibel - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.seibel.lod.core.api.external.coreImplementations.methods.config.client; - -import com.seibel.lod.api.items.enums.config.*; -import com.seibel.lod.api.items.interfaces.config.IDhApiConfig; -import com.seibel.lod.api.items.objects.config.DhApiConfig; -import com.seibel.lod.core.interfaces.config.converters.RenderModeEnabledConverter; -import com.seibel.lod.core.config.Config; -import com.seibel.lod.api.items.enums.rendering.ERendererMode; -import com.seibel.lod.core.config.Config.Client.Graphics.Quality; -import com.seibel.lod.core.config.Config.Client.Advanced.Debugging; -import com.seibel.lod.core.config.Config.Client.Graphics.AdvancedGraphics; - -/** - * Distant Horizons' graphics/rendering configuration. - * - * @author James Seibel - * @version 2022-7-11 - */ -public class DhApiGraphics -{ - - //========================// - // basic graphic settings // - //========================// - - /** The distance is the radius measured in chunks. */ - public static IDhApiConfig getChunkRenderDistanceConfig() - { return new DhApiConfig<>(Quality.lodChunkRenderDistance); } - - /** - * Simplified version of {@link DhApiGraphics#getRenderingModeConfig()} - * that only enables/disables the fake chunk rendering.

- * - * Changing this config also changes {@link DhApiGraphics#getRenderingModeConfig()}'s value. - */ - public static IDhApiConfig getRenderingEnabledConfig() - { return new DhApiConfig(Debugging.rendererMode, new RenderModeEnabledConverter()); } - - /** - * Can be used to enable/disable fake chunk rendering or enable the debug renderer.

- * - * The debug renderer is used to confirm rendering is working at and will draw - * a single multicolor rhombus on the screen in skybox space (AKA behind MC's rendering).

- * - * Changing this config also changes {@link DhApiGraphics#getRenderingEnabledConfig()}'s value. - */ - public static IDhApiConfig getRenderingModeConfig() - { return new DhApiConfig<>(Debugging.rendererMode); } - - - - //==================// - // graphic settings // - //==================// - - /** Defines how detailed fake chunks are in the horizontal direction */ - public static IDhApiConfig getMaxDetailLevelConfig() - { return new DhApiConfig<>(Quality.drawResolution); } - - /** Defines how detailed fake chunks are in the vertical direction */ - public static IDhApiConfig getVerticalQualityConfig() - { return new DhApiConfig<>(Quality.verticalQuality); } - - /** Modifies the quadratic function fake chunks use for horizontal quality drop-off. */ - public static IDhApiConfig getHorizontalQualityDropoffConfig() - { return new DhApiConfig<>(Quality.horizontalQuality); } - - /** - * The same as vanilla Minecraft's biome blending.

- * - * 0 = blending of 1x1 aka off
- * 1 = blending of 3x3
- * 2 = blending of 5x5
- * ...
- */ - public static IDhApiConfig getBiomeBlendingConfig() - { return new DhApiConfig<>(Quality.lodBiomeBlending); } - - - - //===========================// - // advanced graphic settings // - //===========================// - - /** If directional culling is disabled fake chunks will be rendered behind the camera. */ - public static IDhApiConfig getDisableDirectionalCullingConfig() - { return new DhApiConfig<>(AdvancedGraphics.disableDirectionalCulling); } - - /** Determines how fake chunks are rendered in comparison to vanilla MC's chunks. */ - public static IDhApiConfig getVanillaOverdrawConfig() - { return new DhApiConfig<>(AdvancedGraphics.vanillaOverdraw); } - - /** Modifies how far the vanilla overdraw is rendered in chunks. */ - public static IDhApiConfig getVanillaOverdrawOffsetConfig() - { return new DhApiConfig<>(AdvancedGraphics.overdrawOffset); } - - /** - * If enabled the near clip plane is extended to reduce - * overdraw and improve Z-fighting at extreme render distances.
- * Disabling this reduces holes in the world due to the near clip plane - * being too close to the camera and the terrain not being covered by vanilla terrain. - */ - public static IDhApiConfig getUseExtendedNearClipPlaneConfig() - { return new DhApiConfig<>(AdvancedGraphics.useExtendedNearClipPlane); } - - /** - * Modifies how bright fake chunks are.
- * This is done when generating the vertex data and is applied before any shaders. - */ - public static IDhApiConfig getBrightnessMultiplierConfig() - { return new DhApiConfig<>(AdvancedGraphics.brightnessMultiplier); } - - /** - * Modifies how saturated fake chunks are.
- * This is done when generating the vertex data and is applied before any shaders. - */ - public static IDhApiConfig getSaturationMultiplierConfig() - { return new DhApiConfig<>(AdvancedGraphics.saturationMultiplier); } - - /** Defines if Distant Horizons should attempt to cull fake chunk cave geometry. */ - public static IDhApiConfig getCaveCullingEnabledConfig() - { return new DhApiConfig<>(AdvancedGraphics.enableCaveCulling); } - - /** Defines what height cave culling should be used below if enabled. */ - public static IDhApiConfig getCaveCullingHeightConfig() - { return new DhApiConfig<>(AdvancedGraphics.caveCullingHeight); } - - /** This ratio is relative to Earth's real world curvature. */ - public static IDhApiConfig getEarthCurvatureRatioConfig() - { return new DhApiConfig<>(AdvancedGraphics.earthCurveRatio); } - - /** If enabled vanilla chunk rendering is disabled and only fake chunks are rendered. */ - public static IDhApiConfig getEnableLodOnlyModeConfig() - { return new DhApiConfig<>(Config.Client.Advanced.lodOnlyMode); } - - /** Defines how often the geometry should be rebuilt when the player moves. */ - public static IDhApiConfig getGeometryRebuildFrequencyConfig() - { return new DhApiConfig<>(Config.Client.Advanced.Buffers.rebuildTimes); } - - - -} diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiGraphicsConfig.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiGraphicsConfig.java new file mode 100644 index 000000000..641a5b775 --- /dev/null +++ b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiGraphicsConfig.java @@ -0,0 +1,132 @@ +/* + * This file is part of the Distant Horizons mod (formerly the LOD Mod), + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020-2022 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.seibel.lod.core.api.external.coreImplementations.methods.config.client; + +import com.seibel.lod.api.items.enums.config.*; +import com.seibel.lod.api.items.interfaces.config.IDhApiConfig; +import com.seibel.lod.api.items.interfaces.config.client.IDhApiGraphicsConfig; +import com.seibel.lod.api.items.objects.config.DhApiConfig; +import com.seibel.lod.core.interfaces.config.converters.RenderModeEnabledConverter; +import com.seibel.lod.core.config.Config; +import com.seibel.lod.api.items.enums.rendering.ERendererMode; +import com.seibel.lod.core.config.Config.Client.Graphics.Quality; +import com.seibel.lod.core.config.Config.Client.Advanced.Debugging; +import com.seibel.lod.core.config.Config.Client.Graphics.AdvancedGraphics; + +/** + * Distant Horizons' graphics/rendering configuration. + * + * @author James Seibel + * @version 2022-9-15 + */ +public class DhApiGraphicsConfig implements IDhApiGraphicsConfig +{ + + //========================// + // basic graphic settings // + //========================// + + @Override + public IDhApiConfig getChunkRenderDistanceConfig() + { return new DhApiConfig<>(Quality.lodChunkRenderDistance); } + + @Override + public IDhApiConfig getRenderingEnabledConfig() + { return new DhApiConfig(Debugging.rendererMode, new RenderModeEnabledConverter()); } + + @Override + public IDhApiConfig getRenderingModeConfig() + { return new DhApiConfig<>(Debugging.rendererMode); } + + + + //==================// + // graphic settings // + //==================// + + @Override + public IDhApiConfig getMaxDetailLevelConfig() + { return new DhApiConfig<>(Quality.drawResolution); } + + @Override + public IDhApiConfig getVerticalQualityConfig() + { return new DhApiConfig<>(Quality.verticalQuality); } + + @Override + public IDhApiConfig getHorizontalQualityDropoffConfig() + { return new DhApiConfig<>(Quality.horizontalQuality); } + + @Override + public IDhApiConfig getBiomeBlendingConfig() + { return new DhApiConfig<>(Quality.lodBiomeBlending); } + + + + //===========================// + // advanced graphic settings // + //===========================// + + @Override + public IDhApiConfig getDisableDirectionalCullingConfig() + { return new DhApiConfig<>(AdvancedGraphics.disableDirectionalCulling); } + + @Override + public IDhApiConfig getVanillaOverdrawConfig() + { return new DhApiConfig<>(AdvancedGraphics.vanillaOverdraw); } + + @Override + public IDhApiConfig getVanillaOverdrawOffsetConfig() + { return new DhApiConfig<>(AdvancedGraphics.overdrawOffset); } + + @Override + public IDhApiConfig getUseExtendedNearClipPlaneConfig() + { return new DhApiConfig<>(AdvancedGraphics.useExtendedNearClipPlane); } + + @Override + public IDhApiConfig getBrightnessMultiplierConfig() + { return new DhApiConfig<>(AdvancedGraphics.brightnessMultiplier); } + + @Override + public IDhApiConfig getSaturationMultiplierConfig() + { return new DhApiConfig<>(AdvancedGraphics.saturationMultiplier); } + + @Override + public IDhApiConfig getCaveCullingEnabledConfig() + { return new DhApiConfig<>(AdvancedGraphics.enableCaveCulling); } + + @Override + public IDhApiConfig getCaveCullingHeightConfig() + { return new DhApiConfig<>(AdvancedGraphics.caveCullingHeight); } + + @Override + public IDhApiConfig getEarthCurvatureRatioConfig() + { return new DhApiConfig<>(AdvancedGraphics.earthCurveRatio); } + + @Override + public IDhApiConfig getEnableLodOnlyModeConfig() + { return new DhApiConfig<>(Config.Client.Advanced.lodOnlyMode); } + + @Override + public IDhApiConfig getGeometryRebuildFrequencyConfig() + { return new DhApiConfig<>(Config.Client.Advanced.Buffers.rebuildTimes); } + + + +} diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiGraphicsFog.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiGraphicsFog.java deleted file mode 100644 index 7fc974e4f..000000000 --- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiGraphicsFog.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * This file is part of the Distant Horizons mod (formerly the LOD Mod), - * licensed under the GNU LGPL v3 License. - * - * Copyright (C) 2020-2022 James Seibel - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.seibel.lod.core.api.external.coreImplementations.methods.config.client; - -import com.seibel.lod.api.items.enums.rendering.*; -import com.seibel.lod.api.items.interfaces.config.IDhApiConfig; -import com.seibel.lod.api.items.objects.config.DhApiConfig; -import com.seibel.lod.core.config.Config.Client.Graphics.FogQuality; - -/** - * Distant Horizons' fog configuration.

- * - * Note: unless an option explicitly states that it modifies - * Minecraft's vanilla rendering (like DisableVanillaFog) - * these settings will only affect Distant horizons' fog. - * - * @author James Seibel - * @version 2022-7-11 - */ -public class DhApiGraphicsFog -{ - - //====================// - // basic fog settings // - //====================// - - /** Defines at what distance fog is rendered on fake chunks. */ - public static IDhApiConfig getFogDistanceConfig() - { return new DhApiConfig<>(FogQuality.fogDistance); } - - /** Should be used to enable/disable fog rendering. */ - public static IDhApiConfig getFogRenderConfig() - { return new DhApiConfig<>(FogQuality.fogDrawMode); } - - /** Can be used to enable support with mods that change vanilla MC's fog color. */ - public static IDhApiConfig getFogColorConfig() - { return new DhApiConfig<>(FogQuality.fogColorMode); } - - /** - * If enabled attempts to disable vanilla MC's fog on real chunks.
- * May not play nice with other fog editing mods. - */ - public static IDhApiConfig getDisableVanillaFogConfig() - { return new DhApiConfig<>(FogQuality.disableVanillaFog); } - - - //=======================// - // advanced fog settings // - //=======================// - - /** - * Defines where the fog starts as a percent of the - * fake chunks render distance radius.
- * Can be greater than the fog end distance to invert the fog direction.

- * - * 0.0 = fog starts at the camera
- * 1.0 = fog starts at the edge of the fake chunk render distance
- */ - public static IDhApiConfig getFogStartDistanceConfig() - { return new DhApiConfig<>(FogQuality.AdvancedFog.farFogStart); } - - /** - * Defines where the fog ends as a percent of the radius - * of the fake chunks render distance.
- * Can be less than the fog start distance to invert the fog direction.

- * - * 0.0 = fog ends at the camera
- * 1.0 = fog ends at the edge of the fake chunk render distance
- */ - public static IDhApiConfig getFogEndDistanceConfig() - { return new DhApiConfig<>(FogQuality.AdvancedFog.farFogEnd); } - - /** Defines how opaque the fog is at its thinnest point. */ - public static IDhApiConfig getFogMinThicknessConfig() - { return new DhApiConfig<>(FogQuality.AdvancedFog.farFogMin); } - - /** Defines how opaque the fog is at its thickest point. */ - public static IDhApiConfig getFogMaxThicknessConfig() - { return new DhApiConfig<>(FogQuality.AdvancedFog.farFogMax); } - - /** Defines how the fog changes in thickness. */ - public static IDhApiConfig getFogFalloffConfig() - { return new DhApiConfig<>(FogQuality.AdvancedFog.farFogType); } - - /** Defines the fog density. */ - public static IDhApiConfig getFogDensityConfig() - { return new DhApiConfig<>(FogQuality.AdvancedFog.farFogDensity); } - - - //=====================// - // height fog settings // - //=====================// - - /** Defines how the height fog mixes. */ - public static IDhApiConfig getHeightFogMixModeConfig() - { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogMixMode); } - - /** Defines how the height fog is drawn relative to the camera or world. */ - public static IDhApiConfig getHeightFogModeConfig() - { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogMode); } - - /** - * Defines the height fog's base height if {@link DhApiGraphicsFog#getHeightFogModeConfig()} - * is set to use a specific height. - */ - public static IDhApiConfig getHeightFogBaseHeightConfig() - { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogHeight); } - - /** Defines the height fog's starting height as a percent of the world height. */ - public static IDhApiConfig getHeightFogStartingHeightPercentConfig() - { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogStart); } - - /** Defines the height fog's ending height as a percent of the world height. */ - public static IDhApiConfig getHeightFogEndingHeightPercentConfig() - { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogEnd); } - - /** Defines how opaque the height fog is at its thinnest point. */ - public static IDhApiConfig getHeightFogMinThicknessConfig() - { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogMin); } - - /** Defines how opaque the height fog is at its thickest point. */ - public static IDhApiConfig getHeightFogMaxThicknessConfig() - { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogMax); } - - /** Defines how the height fog changes in thickness. */ - public static IDhApiConfig getHeightFogFalloffConfig() - { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogType); } - - /** Defines the height fog's density. */ - public static IDhApiConfig getHeightFogDensityConfig() - { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogDensity); } - - -} diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiGraphicsFogConfig.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiGraphicsFogConfig.java new file mode 100644 index 000000000..4726397eb --- /dev/null +++ b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiGraphicsFogConfig.java @@ -0,0 +1,131 @@ +/* + * This file is part of the Distant Horizons mod (formerly the LOD Mod), + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020-2022 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.seibel.lod.core.api.external.coreImplementations.methods.config.client; + +import com.seibel.lod.api.items.enums.rendering.*; +import com.seibel.lod.api.items.interfaces.config.IDhApiConfig; +import com.seibel.lod.api.items.interfaces.config.client.IDhApiGraphicsFogConfig; +import com.seibel.lod.api.items.objects.config.DhApiConfig; +import com.seibel.lod.core.config.Config.Client.Graphics.FogQuality; + +/** + * Distant Horizons' fog configuration.

+ * + * Note: unless an option explicitly states that it modifies + * Minecraft's vanilla rendering (like DisableVanillaFog) + * these settings will only affect Distant horizons' fog. + * + * @author James Seibel + * @version 2022-9-15 + */ +public class DhApiGraphicsFogConfig implements IDhApiGraphicsFogConfig +{ + + //====================// + // basic fog settings // + //====================// + + @Override + public IDhApiConfig getFogDistanceConfig() + { return new DhApiConfig<>(FogQuality.fogDistance); } + + @Override + public IDhApiConfig getFogRenderConfig() + { return new DhApiConfig<>(FogQuality.fogDrawMode); } + + @Override + public IDhApiConfig getFogColorConfig() + { return new DhApiConfig<>(FogQuality.fogColorMode); } + + @Override + public IDhApiConfig getDisableVanillaFogConfig() + { return new DhApiConfig<>(FogQuality.disableVanillaFog); } + + + //=======================// + // advanced fog settings // + //=======================// + + @Override + public IDhApiConfig getFogStartDistanceConfig() + { return new DhApiConfig<>(FogQuality.AdvancedFog.farFogStart); } + + @Override + public IDhApiConfig getFogEndDistanceConfig() + { return new DhApiConfig<>(FogQuality.AdvancedFog.farFogEnd); } + + @Override + public IDhApiConfig getFogMinThicknessConfig() + { return new DhApiConfig<>(FogQuality.AdvancedFog.farFogMin); } + + @Override + public IDhApiConfig getFogMaxThicknessConfig() + { return new DhApiConfig<>(FogQuality.AdvancedFog.farFogMax); } + + @Override + public IDhApiConfig getFogFalloffConfig() + { return new DhApiConfig<>(FogQuality.AdvancedFog.farFogType); } + + @Override + public IDhApiConfig getFogDensityConfig() + { return new DhApiConfig<>(FogQuality.AdvancedFog.farFogDensity); } + + + //=====================// + // height fog settings // + //=====================// + + @Override + public IDhApiConfig getHeightFogMixModeConfig() + { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogMixMode); } + + @Override + public IDhApiConfig getHeightFogModeConfig() + { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogMode); } + + @Override + public IDhApiConfig getHeightFogBaseHeightConfig() + { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogHeight); } + + @Override + public IDhApiConfig getHeightFogStartingHeightPercentConfig() + { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogStart); } + + @Override + public IDhApiConfig getHeightFogEndingHeightPercentConfig() + { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogEnd); } + + @Override + public IDhApiConfig getHeightFogMinThicknessConfig() + { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogMin); } + + @Override + public IDhApiConfig getHeightFogMaxThicknessConfig() + { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogMax); } + + @Override + public IDhApiConfig getHeightFogFalloffConfig() + { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogType); } + + @Override + public IDhApiConfig getHeightFogDensityConfig() + { return new DhApiConfig<>(FogQuality.AdvancedFog.HeightFog.heightFogDensity); } + +} diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiMultiplayer.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiMultiplayerConfig.java similarity index 65% rename from core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiMultiplayer.java rename to core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiMultiplayerConfig.java index 1d0109f85..7a97a3ff2 100644 --- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiMultiplayer.java +++ b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiMultiplayerConfig.java @@ -20,6 +20,7 @@ package com.seibel.lod.core.api.external.coreImplementations.methods.config.client; import com.seibel.lod.api.items.interfaces.config.IDhApiConfig; +import com.seibel.lod.api.items.interfaces.config.client.IDhApiMultiplayerConfig; import com.seibel.lod.api.items.objects.config.DhApiConfig; import com.seibel.lod.core.config.Config.Client.Multiplayer; import com.seibel.lod.api.items.enums.config.EServerFolderNameMode; @@ -28,29 +29,15 @@ import com.seibel.lod.api.items.enums.config.EServerFolderNameMode; * Distant Horizons' client-side multiplayer configuration. * * @author James Seibel - * @version 2022-7-5 + * @version 2022-9-15 */ -public class DhApiMultiplayer +public class DhApiMultiplayerConfig implements IDhApiMultiplayerConfig { - /** - * Defines how multiplayer server folders are named.
- * Note: Changing this while connected to a multiplayer world will cause undefined behavior! - */ - public static IDhApiConfig getFolderSavingModeConfig() + public IDhApiConfig getFolderSavingModeConfig() { return new DhApiConfig<>(Multiplayer.serverFolderNameMode); } - /** - * Defines the necessary similarity (as a percent) that two potential levels - * need in order to be considered the same.

- * - * Setting this to zero causes every level of a specific dimension type to be consider - * the same level.
- * Setting this to a non-zero value allows for usage in servers that user Multiverse - * or similar mods. - */ - public static IDhApiConfig getMultiverseSimilarityRequirementConfig() + public IDhApiConfig getMultiverseSimilarityRequirementConfig() { return new DhApiConfig<>(Multiplayer.multiDimensionRequiredSimilarity); } - } diff --git a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiThreading.java b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiThreadingConfig.java similarity index 56% rename from core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiThreading.java rename to core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiThreadingConfig.java index e79b3e8db..d60f3951a 100644 --- a/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiThreading.java +++ b/core/src/main/java/com/seibel/lod/core/api/external/coreImplementations/methods/config/client/DhApiThreadingConfig.java @@ -20,6 +20,7 @@ package com.seibel.lod.core.api.external.coreImplementations.methods.config.client; import com.seibel.lod.api.items.interfaces.config.IDhApiConfig; +import com.seibel.lod.api.items.interfaces.config.client.IDhApiThreadingConfig; import com.seibel.lod.api.items.objects.config.DhApiConfig; import com.seibel.lod.core.config.Config.Client.Advanced.Threading; @@ -27,30 +28,15 @@ import com.seibel.lod.core.config.Config.Client.Advanced.Threading; * Distant Horizons' threading configuration. * * @author James Seibel - * @version 2022-7-5 + * @version 2022-9-15 */ -public class DhApiThreading +public class DhApiThreadingConfig implements IDhApiThreadingConfig { - /** - * Defines how many world generator threads are used to generate - * terrain outside Minecraf's vanilla render distance.
- *
- * If the number of threads is less than 1 it will be treated as a percentage - * representing how often the single thread will actively generate terrain.

- * - * 0.1 = 1 thread active 10% of the time
- * 0.5 = 1 thread active 50% of the time
- * 1.0 = 1 thread active 100% of the time
- * 1.5 = 2 threads active 100% of the time (partial values are rounded up)
- * 2.0 = 2 threads active 100% of the time
- * - * @deprecated this (and the related config) should be replaced with an int - * count of threads and then a double percent active config. - */ @Deprecated - public static IDhApiConfig getWorldGeneratorThreadConfig() - { return new DhApiConfig(Threading.numberOfWorldGenerationThreads); } + @Override + public IDhApiConfig getWorldGeneratorThreadConfig() + { return new DhApiConfig<>(Threading.numberOfWorldGenerationThreads); } // TODO the above should be replaced with these // public static IDhApiConfig getWorldGeneratorThreadConfig() @@ -59,9 +45,8 @@ public class DhApiThreading // public static IDhApiConfig getWorldGeneratorThreadActivePercentConfig() // { return new DhApiConfig<>(Threading.ToBeDetermined); } - - /** Defines how many buffer (GPU Terrain data) builder threads are used. */ - public static IDhApiConfig getBufferBuilderThreadConfig() - { return new DhApiConfig(Threading.numberOfBufferBuilderThreads); } + @Override + public IDhApiConfig getBufferBuilderThreadConfig() + { return new DhApiConfig<>(Threading.numberOfBufferBuilderThreads); } }