diff --git a/api/build.gradle b/api/build.gradle
index 9172e5bf8..f99bde859 100644
--- a/api/build.gradle
+++ b/api/build.gradle
@@ -3,7 +3,7 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id "java"
- id "com.github.johnrengelman.shadow" version '7.1.2' apply false
+ id "com.github.johnrengelman.shadow" version '8.1.1' apply false
}
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/DhApi.java b/api/src/main/java/com/seibel/distanthorizons/api/DhApi.java
index 23ffd6669..80ae01702 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/DhApi.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/DhApi.java
@@ -123,7 +123,7 @@ public class DhApi
/**
* Used to create wrappers for Minecraft objects needed by other Distant Horizons API methods.
- * @since API 1.1.0
+ * @since API 2.0.0
*/
public static IDhApiWrapperFactory wrapperFactory = null;
@@ -198,7 +198,7 @@ public class DhApi
/**
* Returns true if the thread this method was called from is owned by Distant Horizons.
- * @since API 1.1.0
+ * @since API 2.0.0
*/
public static boolean isDhThread() { return Thread.currentThread().getName().startsWith(ModInfo.THREAD_NAME_PREFIX); }
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiBlocksToAvoid.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiBlocksToAvoid.java
index 92388135d..2acecc103 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiBlocksToAvoid.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiBlocksToAvoid.java
@@ -23,7 +23,7 @@ package com.seibel.distanthorizons.api.enums.config;
* NONE,
* NON_COLLIDING,
*
- * @since API 1.1.0
+ * @since API 2.0.0
* @version 2024-4-6
*/
public enum EDhApiBlocksToAvoid
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiDataCompressionMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiDataCompressionMode.java
index 4e093a234..7ba0137c7 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiDataCompressionMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiDataCompressionMode.java
@@ -22,14 +22,13 @@ package com.seibel.distanthorizons.api.enums.config;
/**
* UNCOMPRESSED
* LZ4
- * ZSTD
* XZ
*
* Note: speed and compression ratios are examples
* and should only be used for estimated comparisons.
*
* @version 2024-3-16
- * @since API 1.1.0
+ * @since API 2.0.0
*/
public enum EDhApiDataCompressionMode
{
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGLErrorHandlingMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGLErrorHandlingMode.java
index 5e5013613..7887eb9dc 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGLErrorHandlingMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGLErrorHandlingMode.java
@@ -20,7 +20,7 @@
package com.seibel.distanthorizons.api.enums.config;
/**
- * @since API 1.1.0
+ * @since API 2.0.0
* @version 2024-4-6
*/
public enum EDhApiGLErrorHandlingMode
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGlProfileMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGlProfileMode.java
index 3e383e758..e70f6ad00 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGlProfileMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGlProfileMode.java
@@ -20,7 +20,7 @@
package com.seibel.distanthorizons.api.enums.config;
/**
- * @since API 1.1.0
+ * @since API 2.0.0
* @version 2024-4-6
*/
public enum EDhApiGlProfileMode
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGpuUploadMethod.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGpuUploadMethod.java
index 8f3f5ec9c..df4c4a767 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGpuUploadMethod.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGpuUploadMethod.java
@@ -29,7 +29,7 @@ package com.seibel.distanthorizons.api.enums.config;
* @author Leetom
* @author James Seibel
* @version 2024-4-6
- * @since API 1.1.0
+ * @since API 2.0.0
*/
public enum EDhApiGpuUploadMethod
{
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGrassSideRendering.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGrassSideRendering.java
index 2f2f1a8fa..cf96d96e9 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGrassSideRendering.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGrassSideRendering.java
@@ -24,7 +24,7 @@ package com.seibel.distanthorizons.api.enums.config;
* FADE_TO_DIRT
* AS_DIRT
*
- * @since API 1.1.0
+ * @since API 2.0.0
* @version 2024-4-7
*/
public enum EDhApiGrassSideRendering
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiHorizontalQuality.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiHorizontalQuality.java
index bdf7967cf..bf1e0eaf8 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiHorizontalQuality.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiHorizontalQuality.java
@@ -26,7 +26,7 @@ package com.seibel.distanthorizons.api.enums.config;
* HIGH
* UNLIMITED
*
- * @since API 1.1.0
+ * @since API 2.0.0
* @version 2024-4-6
*/
public enum EDhApiHorizontalQuality
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiLodShading.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiLodShading.java
index b3ca135b8..b69be80c4 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiLodShading.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiLodShading.java
@@ -24,7 +24,7 @@ package com.seibel.distanthorizons.api.enums.config;
* ENABLED
* DISABLED
*
- * @since API 1.1.0
+ * @since API 2.0.0
* @version 2024-4-6
*/
public enum EDhApiLodShading
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiLoggerMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiLoggerMode.java
index eb9043a2e..a2c4ead8f 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiLoggerMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiLoggerMode.java
@@ -22,7 +22,7 @@ package com.seibel.distanthorizons.api.enums.config;
import org.apache.logging.log4j.Level;
/**
- * @since API 1.1.0
+ * @since API 2.0.0
* @version 2024-4-6
*/
public enum EDhApiLoggerMode
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiMaxHorizontalResolution.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiMaxHorizontalResolution.java
index 922932c1b..c883695c7 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiMaxHorizontalResolution.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiMaxHorizontalResolution.java
@@ -33,7 +33,7 @@ import com.seibel.distanthorizons.coreapi.util.MathUtil;
*
* @author James Seibel
* @author Leonardo Amato
- * @since API 1.1.0
+ * @since API 2.0.0
* @version 2024-4-6
*/
public enum EDhApiMaxHorizontalResolution
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiServerFolderNameMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiServerFolderNameMode.java
index 69a8ea619..bb8ca0822 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiServerFolderNameMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiServerFolderNameMode.java
@@ -30,7 +30,7 @@ package com.seibel.distanthorizons.api.enums.config;
* Determines how the multiplayer folders should be named.
*
* @author James Seibel
- * @since API 1.1.0
+ * @since API 2.0.0
* @version 2024-4-6
*/
public enum EDhApiServerFolderNameMode
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiUpdateBranch.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiUpdateBranch.java
index e7eab618f..dc94d28f7 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiUpdateBranch.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiUpdateBranch.java
@@ -4,7 +4,7 @@ package com.seibel.distanthorizons.api.enums.config;
* STABLE,
* NIGHTLY,
*
- * @since API 1.1.0
+ * @since API 2.0.0
* @version 2024-4-6
*/
public enum EDhApiUpdateBranch
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiVanillaOverdraw.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiVanillaOverdraw.java
index ed321d493..4efc0eec7 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiVanillaOverdraw.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiVanillaOverdraw.java
@@ -28,7 +28,7 @@ package com.seibel.distanthorizons.api.enums.config;
* the vanilla Minecraft terrain.
*
* @author James Seibel
- * @since API 1.1.0
+ * @since API 2.0.0
* @version 2024-4-6
*/
@Deprecated // not currently in use, if the config this enum represents is re-implemented, the deprecated flag can be removed
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiVerticalQuality.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiVerticalQuality.java
index 0917ab82b..d11dcb90c 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiVerticalQuality.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiVerticalQuality.java
@@ -30,7 +30,7 @@ import com.seibel.distanthorizons.coreapi.util.MathUtil;
*
* @author Leonardo Amato
* @version 2024-4-6
- * @since API 1.1.0
+ * @since API 2.0.0
*/
public enum EDhApiVerticalQuality
{
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiWorldCompressionMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiWorldCompressionMode.java
index d8abc9eb0..2323783f5 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiWorldCompressionMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiWorldCompressionMode.java
@@ -24,7 +24,7 @@ package com.seibel.distanthorizons.api.enums.config;
* VISUALLY_EQUAL
*
* @version 2024-3-27
- * @since API 1.1.0
+ * @since API 2.0.0
*/
public enum EDhApiWorldCompressionMode
{
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EDhApiQualityPreset.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EDhApiQualityPreset.java
index 7bca56868..a66b8ad1a 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EDhApiQualityPreset.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EDhApiQualityPreset.java
@@ -30,7 +30,7 @@ import com.seibel.distanthorizons.api.enums.config.DisallowSelectingViaConfigGui
* HIGH,
* EXTREME,
*
- * @since API 1.1.0
+ * @since API 2.0.0
* @version 2024-4-6
*/
public enum EDhApiQualityPreset
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EDhApiThreadPreset.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EDhApiThreadPreset.java
index b10468e4f..f821cfb23 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EDhApiThreadPreset.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EDhApiThreadPreset.java
@@ -29,7 +29,7 @@ import com.seibel.distanthorizons.api.enums.config.DisallowSelectingViaConfigGui
* BALANCED,
* AGGRESSIVE,
*
- * @since API 1.1.0
+ * @since API 2.0.0
* @version 2024-4-6
*/
public enum EDhApiThreadPreset
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiDebugRendering.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiDebugRendering.java
index 646f9f25a..938493bb6 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiDebugRendering.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiDebugRendering.java
@@ -29,7 +29,7 @@ package com.seibel.distanthorizons.api.enums.rendering;
* @author Leetom
* @author James Seibel
* @version 2024-4-6
- * @since API 1.1.0
+ * @since API 2.0.0
*/
public enum EDhApiDebugRendering
{
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiFogColorMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiFogColorMode.java
index 8900574c5..bceaccb41 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiFogColorMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiFogColorMode.java
@@ -25,7 +25,7 @@ package com.seibel.distanthorizons.api.enums.rendering;
*
* @author James Seibel
* @version 2024-4-6
- * @since API 1.1.0
+ * @since API 2.0.0
*/
public enum EDhApiFogColorMode
{
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiFogDrawMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiFogDrawMode.java
index 1bc322109..ce2e2ff8d 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiFogDrawMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiFogDrawMode.java
@@ -25,7 +25,7 @@ package com.seibel.distanthorizons.api.enums.rendering;
* FOG_DISABLED
*
* @author James Seibel
- * @since API 1.1.0
+ * @since API 2.0.0
* @version 2022-6-2
*/
public enum EDhApiFogDrawMode
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiFogFalloff.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiFogFalloff.java
index 4f310bf17..3437cd00a 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiFogFalloff.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiFogFalloff.java
@@ -26,7 +26,7 @@ package com.seibel.distanthorizons.api.enums.rendering;
*
* @author Leetom
* @version 2022-6-30
- * @since API 1.1.0
+ * @since API 2.0.0
*/
public enum EDhApiFogFalloff
{
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiHeightFogMixMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiHeightFogMixMode.java
index 13ab79dbb..56226f2da 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiHeightFogMixMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiHeightFogMixMode.java
@@ -33,7 +33,7 @@ package com.seibel.distanthorizons.api.enums.rendering;
*
* @author Leetom
* @version 2024-4-6
- * @since API 1.1.0
+ * @since API 2.0.0
*/
public enum EDhApiHeightFogMixMode
{
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiHeightFogMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiHeightFogMode.java
index 99e538603..81a847630 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiHeightFogMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiHeightFogMode.java
@@ -29,7 +29,7 @@ package com.seibel.distanthorizons.api.enums.rendering;
*
* @author Leetom
* @version 2024-4-6
- * @since API 1.1.0
+ * @since API 2.0.0
*/
public enum EDhApiHeightFogMode
{
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiRenderPass.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiRenderPass.java
index 260609f8d..707d66200 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiRenderPass.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiRenderPass.java
@@ -7,7 +7,7 @@ package com.seibel.distanthorizons.api.enums.rendering;
*
* @author James Seibel
* @version 2024-1-30
- * @since API 1.1.0
+ * @since API 2.0.0
*/
public enum EDhApiRenderPass
{
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiRendererMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiRendererMode.java
index 87a7099b1..2a216a281 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiRendererMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiRendererMode.java
@@ -24,7 +24,7 @@ package com.seibel.distanthorizons.api.enums.rendering;
* Debug
* Disabled
*
- * @since API 1.1.0
+ * @since API 2.0.0
* @version 2024-4-6
*/
public enum EDhApiRendererMode
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiTransparency.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiTransparency.java
index 495c8fe6e..613b8ddfb 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiTransparency.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiTransparency.java
@@ -24,7 +24,7 @@ package com.seibel.distanthorizons.api.enums.rendering;
* FAKE,
* COMPLETE,
*
- * @since API 1.1.0
+ * @since API 2.0.0
* @version 2024-4-6
*/
public enum EDhApiTransparency
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/worldGeneration/EDhApiWorldGeneratorReturnType.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/worldGeneration/EDhApiWorldGeneratorReturnType.java
index 30e411b69..b77dd2ea3 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/worldGeneration/EDhApiWorldGeneratorReturnType.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/worldGeneration/EDhApiWorldGeneratorReturnType.java
@@ -31,7 +31,7 @@ import java.util.function.Consumer;
*
* @author Builderb0y, James Seibel
* @version 2023-12-21
- * @since API 1.1.0
+ * @since API 2.0.0
*/
public enum EDhApiWorldGeneratorReturnType
{
@@ -40,7 +40,7 @@ public enum EDhApiWorldGeneratorReturnType
* {@link IDhApiWorldGenerator#generateChunks(int, int, byte, byte, EDhApiDistantGeneratorMode, ExecutorService, Consumer)}
* will be used when generating terrain.
*
- * @since API 1.1.0
+ * @since API 2.0.0
*/
VANILLA_CHUNKS,
@@ -49,7 +49,7 @@ public enum EDhApiWorldGeneratorReturnType
* {@link IDhApiWorldGenerator#generateApiChunks(int, int, byte, byte, EDhApiDistantGeneratorMode, ExecutorService, Consumer)}
* will be used when generating terrain.
*
- * @since API 1.1.0
+ * @since API 2.0.0
*/
API_CHUNKS;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/IDhApiConfigValue.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/IDhApiConfigValue.java
index e7947349d..c5b638cd0 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/IDhApiConfigValue.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/IDhApiConfigValue.java
@@ -47,7 +47,7 @@ public interface IDhApiConfigValue
* Returns the value of the config if it was set by the API.
* Returns null if the config hasn't been set by the API.
*
- * @since API 1.1.0
+ * @since API 2.0.0
*/
T getApiValue();
@@ -68,7 +68,7 @@ public interface IDhApiConfigValue
* use the value set in the config menu.
*
* @return true if the value was set, false otherwise.
- * @since API 1.1.0
+ * @since API 2.0.0
*/
boolean clearValue();
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiGraphicsConfig.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiGraphicsConfig.java
index eaf51d691..d7c2792f4 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiGraphicsConfig.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiGraphicsConfig.java
@@ -121,7 +121,7 @@ public interface IDhApiGraphicsConfig extends IDhApiConfigGroup
* Setting this to 0 will reduce/prevent holes in the world due to clipping to close to the camera
* but may cause overdraw issues with transparent or non-full blocks.
*
- * @since API 1.1.0
+ * @since API 2.0.0
*/
IDhApiConfigValue overdrawPreventionRadius();
@@ -158,7 +158,7 @@ public interface IDhApiGraphicsConfig extends IDhApiConfigGroup
/**
* Determines how LODs should be shaded.
*
- * @since API 1.1.0
+ * @since API 2.0.0
*/
IDhApiConfigValue lodShading();
@@ -171,7 +171,7 @@ public interface IDhApiGraphicsConfig extends IDhApiConfigGroup
* start/stop rendering incorrectly based on the camera direction,
* but will also reduce FPS.
*
- * @since API 1.1.0
+ * @since API 2.0.0
* @see IDhApiGraphicsConfig#disableShadowFrustumCulling()
*/
IDhApiConfigValue disableFrustumCulling();
@@ -183,7 +183,7 @@ public interface IDhApiGraphicsConfig extends IDhApiConfigGroup
*
* Disable this if shadows render incorrectly.
*
- * @since API 1.1.0
+ * @since API 2.0.0
* @see IDhApiGraphicsConfig#disableFrustumCulling()
*/
IDhApiConfigValue disableShadowFrustumCulling();
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/factories/IDhApiWrapperFactory.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/factories/IDhApiWrapperFactory.java
index d8dd81ffa..524742f04 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/factories/IDhApiWrapperFactory.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/factories/IDhApiWrapperFactory.java
@@ -31,7 +31,7 @@ import java.io.IOException;
*
* @author James Seibel
* @version 2023-12-16
- * @since API 1.1.0
+ * @since API 2.0.0
*/
public interface IDhApiWrapperFactory
{
@@ -50,7 +50,7 @@ public interface IDhApiWrapperFactory
* @throws ClassCastException if any of the given parameters is of the wrong type.
* If thrown the error message will contain the list of expected object types in order.
*
- * @since API 1.1.0
+ * @since API 2.0.0
*/
IDhApiBiomeWrapper getBiomeWrapper(Object[] objectArray, IDhApiLevelWrapper levelWrapper) throws ClassCastException;
@@ -67,13 +67,13 @@ public interface IDhApiWrapperFactory
* @throws ClassCastException if any of the given parameters is of the wrong type.
* If thrown the error message will contain the list of expected object types in order.
*
- * @since API 1.1.0
+ * @since API 2.0.0
*/
IDhApiBlockStateWrapper getBlockStateWrapper(Object[] objectArray, IDhApiLevelWrapper levelWrapper) throws ClassCastException;
/**
* Returns the {@link IDhApiBlockStateWrapper} representing air.
- * @since API 1.1.0
+ * @since API 2.0.0
*/
IDhApiBlockStateWrapper getAirBlockStateWrapper();
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/rendering/IDhApiCullingFrustum.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/rendering/IDhApiCullingFrustum.java
index 34ab19eb9..44106b82a 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/rendering/IDhApiCullingFrustum.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/rendering/IDhApiCullingFrustum.java
@@ -29,7 +29,7 @@ import com.seibel.distanthorizons.coreapi.util.math.Mat4f;
*
* @author James Seibel
* @version 2024-2-6
- * @since API 1.1.0
+ * @since API 2.0.0
*/
public interface IDhApiCullingFrustum extends IDhApiOverrideable
{
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/rendering/IDhApiFramebuffer.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/rendering/IDhApiFramebuffer.java
index 67c702b2f..6ef90e95d 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/rendering/IDhApiFramebuffer.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/rendering/IDhApiFramebuffer.java
@@ -24,7 +24,7 @@ import com.seibel.distanthorizons.api.interfaces.override.IDhApiOverrideable;
/**
* @author James Seibel
* @version 2024-1-24
- * @since API 1.1.0
+ * @since API 2.0.0
*/
public interface IDhApiFramebuffer extends IDhApiOverrideable
{
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/rendering/IDhApiShaderProgram.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/rendering/IDhApiShaderProgram.java
index 2c02f6c63..6f329121d 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/rendering/IDhApiShaderProgram.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/rendering/IDhApiShaderProgram.java
@@ -27,7 +27,7 @@ import com.seibel.distanthorizons.coreapi.util.math.Vec3f;
/**
* @author James Seibel
* @version 2024-1-24
- * @since API 1.1.0
+ * @since API 2.0.0
*/
public interface IDhApiShaderProgram extends IDhApiOverrideable
{
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/rendering/IDhApiShadowCullingFrustum.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/rendering/IDhApiShadowCullingFrustum.java
index 5759587a0..5748d06d9 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/rendering/IDhApiShadowCullingFrustum.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/rendering/IDhApiShadowCullingFrustum.java
@@ -35,7 +35,7 @@ import com.seibel.distanthorizons.coreapi.util.math.Mat4f;
*
* @author James Seibel
* @version 2024-2-10
- * @since API 1.1.0
+ * @since API 2.0.0
*/
public interface IDhApiShadowCullingFrustum extends IDhApiCullingFrustum
{
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/worldGenerator/IDhApiWorldGenerator.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/worldGenerator/IDhApiWorldGenerator.java
index 16f3c0a68..eb1831973 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/worldGenerator/IDhApiWorldGenerator.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/override/worldGenerator/IDhApiWorldGenerator.java
@@ -168,7 +168,7 @@ public interface IDhApiWorldGenerator extends Closeable, IDhApiOverrideable
*
* @return a future that should run on the worldGeneratorThreadPool and complete once the given generation task has completed.
*
- * @since API 1.1.0
+ * @since API 2.0.0
*/
default CompletableFuture generateApiChunks(
int chunkPosMinX,
@@ -189,7 +189,7 @@ public interface IDhApiWorldGenerator extends Closeable, IDhApiOverrideable
* which means that {@link #generateChunks(int, int, byte, byte, EDhApiDistantGeneratorMode, ExecutorService, Consumer)}
* will be invoked whenever Distant Horizons wants to generate terrain with this world generator.
*
- * @since API 1.1.0
+ * @since API 2.0.0
*/
default EDhApiWorldGeneratorReturnType getReturnType() { return EDhApiWorldGeneratorReturnType.VANILLA_CHUNKS; }
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeApplyShaderRenderEvent.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeApplyShaderRenderEvent.java
index 60281a1ac..975c5e4dc 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeApplyShaderRenderEvent.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeApplyShaderRenderEvent.java
@@ -31,7 +31,7 @@ import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhAp
*
* @author James Seibel
* @version 2024-1-31
- * @since API 1.1.0
+ * @since API 2.0.0
*/
public abstract class DhApiBeforeApplyShaderRenderEvent implements IDhApiCancelableEvent
{
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeBufferRenderEvent.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeBufferRenderEvent.java
index 1bbb88b2b..7716fda0c 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeBufferRenderEvent.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeBufferRenderEvent.java
@@ -30,7 +30,7 @@ import com.seibel.distanthorizons.coreapi.util.math.Vec3f;
*
* @author James Seibel
* @version 2023-1-31
- * @since API 1.1.0
+ * @since API 2.0.0
*
* @see DhApiBeforeRenderEvent
*/
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeDeferredRenderEvent.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeDeferredRenderEvent.java
index 3f22c4a54..066003c7f 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeDeferredRenderEvent.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeDeferredRenderEvent.java
@@ -29,7 +29,7 @@ import com.seibel.distanthorizons.api.interfaces.render.IDhApiRenderProxy;
*
* @author James Seibel
* @version 2024-1-22
- * @since API 1.1.0
+ * @since API 2.0.0
*/
public abstract class DhApiBeforeDeferredRenderEvent extends DhApiBeforeRenderEvent
{
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeRenderCleanupEvent.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeRenderCleanupEvent.java
index aca5cff1f..b8eb08568 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeRenderCleanupEvent.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeRenderCleanupEvent.java
@@ -29,7 +29,7 @@ import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhAp
*
* @author James Seibel
* @version 2024-1-31
- * @since API 1.1.0
+ * @since API 2.0.0
*/
public abstract class DhApiBeforeRenderCleanupEvent implements IDhApiEvent
{
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeRenderPassEvent.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeRenderPassEvent.java
index b12784ced..eabf146ee 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeRenderPassEvent.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeRenderPassEvent.java
@@ -31,7 +31,7 @@ import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhAp
*
* @author James Seibel
* @version 2023-1-31
- * @since API 1.1.0
+ * @since API 2.0.0
*
* @see DhApiBeforeRenderEvent
*/
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeRenderSetupEvent.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeRenderSetupEvent.java
index 4ebb8fe74..0bad3630e 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeRenderSetupEvent.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeRenderSetupEvent.java
@@ -29,7 +29,7 @@ import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhAp
*
* @author James Seibel
* @version 2024-1-31
- * @since API 1.1.0
+ * @since API 2.0.0
*
* @see DhApiBeforeRenderPassEvent
*/
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeTextureClearEvent.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeTextureClearEvent.java
index ff87569bb..410179885 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeTextureClearEvent.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeTextureClearEvent.java
@@ -31,7 +31,7 @@ import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhAp
*
* @author James Seibel
* @version 2024-1-31
- * @since API 1.1.0
+ * @since API 2.0.0
*/
public abstract class DhApiBeforeTextureClearEvent implements IDhApiCancelableEvent
{
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiColorDepthTextureCreatedEvent.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiColorDepthTextureCreatedEvent.java
index c67cd547d..be4f07008 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiColorDepthTextureCreatedEvent.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiColorDepthTextureCreatedEvent.java
@@ -28,7 +28,7 @@ import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhAp
*
* @author James Seibel
* @version 2024-3-2
- * @since API 1.1.0
+ * @since API 2.0.0
*/
public abstract class DhApiColorDepthTextureCreatedEvent implements IDhApiEvent
{
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/sharedParameterObjects/DhApiRenderParam.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/sharedParameterObjects/DhApiRenderParam.java
index 55bd918e0..3e5dbcae3 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/sharedParameterObjects/DhApiRenderParam.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/sharedParameterObjects/DhApiRenderParam.java
@@ -58,9 +58,6 @@ public class DhApiRenderParam
/** The model view matrix Distant Horizons is using to render this frame. */
public final Mat4f dhModelViewMatrix;
- public final int lightmapBindingIndex = 0;
-
- // TODO why is this here? wouldn't it make more sense to have this built into the vertex buffer data?
public final int worldYOffset;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/objects/data/DhApiChunk.java b/api/src/main/java/com/seibel/distanthorizons/api/objects/data/DhApiChunk.java
index b8f479ff7..84e92da58 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/objects/data/DhApiChunk.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/objects/data/DhApiChunk.java
@@ -30,7 +30,7 @@ import java.util.List;
*
* @author Builderb0y, James Seibel
* @version 2023-12-21
- * @since API 1.1.0
+ * @since API 2.0.0
*
* @see IDhApiWrapperFactory
* @see DhApiTerrainDataPoint
diff --git a/api/src/main/java/com/seibel/distanthorizons/coreapi/ModInfo.java b/api/src/main/java/com/seibel/distanthorizons/coreapi/ModInfo.java
index e2c13696f..72e1539a9 100644
--- a/api/src/main/java/com/seibel/distanthorizons/coreapi/ModInfo.java
+++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/ModInfo.java
@@ -47,9 +47,9 @@ public final class ModInfo
public static boolean IS_DEV_BUILD = VERSION.toLowerCase().contains("dev");
/** This version should only be updated when breaking changes are introduced to the DH API */
- public static final int API_MAJOR_VERSION = 1;
+ public static final int API_MAJOR_VERSION = 2;
/** This version should be updated whenever new methods are added to the DH API */
- public static final int API_MINOR_VERSION = 1;
+ public static final int API_MINOR_VERSION = 0;
/** This version should be updated whenever non-breaking fixes are added to the DH API */
public static final int API_PATH_VERSION = 0;
diff --git a/core/build.gradle b/core/build.gradle
index 7e3e9ac7a..60a6bdf4b 100644
--- a/core/build.gradle
+++ b/core/build.gradle
@@ -1,6 +1,6 @@
plugins {
id "java"
- id "com.github.johnrengelman.shadow" version '7.1.2' apply false // Set this to true if you're using the standalone Core project
+ id "com.github.johnrengelman.shadow" version '8.1.1' apply false // Set this to true if you're using the standalone Core project
}
apply plugin: "application"
@@ -57,7 +57,7 @@ artifacts {
}
shadowJar {
- def librariesLocation = "distanthorizons.libraries"
+ def librariesLocation = "DistantHorizons.libraries"
// relocate "it.unimi.dsi.fastutil", "${librariesLocation}.unimi.dsi.fastutil"
mergeServiceFiles()
}
\ No newline at end of file
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/data/DhApiTerrainDataRepo.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/data/DhApiTerrainDataRepo.java
index e3f4f5210..d08989ad8 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/data/DhApiTerrainDataRepo.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/data/DhApiTerrainDataRepo.java
@@ -205,7 +205,7 @@ public class DhApiTerrainDataRepo implements IDhApiTerrainDataRepo
byte sectionDetailLevel = (byte) (requestedDetailLevel + DhSectionPos.SECTION_MINIMUM_DETAIL_LEVEL);
// get the positions for this request
- DhSectionPos sectionPos = requestedColumnPos.getSectionPosWithSectionDetailLevel(sectionDetailLevel);
+ long sectionPos = requestedColumnPos.getSectionPosWithSectionDetailLevel(sectionDetailLevel);
DhLodPos relativePos = requestedColumnPos.getDhSectionRelativePositionForDetailLevel();
@@ -215,7 +215,7 @@ public class DhApiTerrainDataRepo implements IDhApiTerrainDataRepo
FullDataSourceV2 dataSource = level.getFullDataProvider().getAsync(sectionPos).get();
if (dataSource == null)
{
- return DhApiResult.createFail("Unable to find/generate any data at the " + DhSectionPos.class.getSimpleName() + " [" + sectionPos + "].");
+ return DhApiResult.createFail("Unable to find/generate any data at the " + DhSectionPos.class.getSimpleName() + " [" + DhSectionPos.toString(sectionPos) + "].");
}
else
{
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/internal/ClientApi.java b/core/src/main/java/com/seibel/distanthorizons/core/api/internal/ClientApi.java
index fe9ad3d87..94e1c904b 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/internal/ClientApi.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/internal/ClientApi.java
@@ -492,6 +492,17 @@ public class ClientApi
}
finally
{
+ try
+ {
+ // these tasks always need to be called, regardless of whether the renderer is enabled or not to prevent memory leaks
+ GLProxy.getInstance().runRenderThreadTasks();
+ }
+ catch (Exception e)
+ {
+ LOGGER.error("Unexpected issue running render thread tasks.", e);
+ }
+
+
profiler.pop(); // end LOD
profiler.push("terrain"); // go back into "terrain"
}
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/Config.java b/core/src/main/java/com/seibel/distanthorizons/core/config/Config.java
index 223c6fed8..48fcfef10 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/config/Config.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/config/Config.java
@@ -106,6 +106,7 @@ public class Config
public static ConfigEntry optionsButton = new ConfigEntry.Builder()
.set(true)
+ .setAppearance(EConfigEntryAppearance.ONLY_IN_FILE)
.comment("" +
"Should Distant Horizon's config button appear in the options screen next to fov slider?")
.build();
@@ -1352,6 +1353,11 @@ public class Config
.comment("Render LOD section status?")
.build();
+ public static ConfigEntry showQuadTreeRenderStatus = new ConfigEntry.Builder()
+ .set(false)
+ .comment("Render Quad Tree Rendering status?")
+ .build();
+
public static ConfigEntry showFullDataUpdateStatus = new ConfigEntry.Builder()
.set(false)
.comment("Render full data update/lock status?")
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/FullDataPointIdMap.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/FullDataPointIdMap.java
index 229fbbea7..5cb41981e 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/FullDataPointIdMap.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/FullDataPointIdMap.java
@@ -67,7 +67,7 @@ public class FullDataPointIdMap
private final ReentrantReadWriteLock readWriteLock = new ReentrantReadWriteLock();
/** should only be used for debugging */
- private DhSectionPos pos;
+ private long pos;
/** The index should be the same as the Entry's ID */
private final ArrayList entryList = new ArrayList<>();
@@ -79,7 +79,7 @@ public class FullDataPointIdMap
// constructor //
//=============//
- public FullDataPointIdMap(DhSectionPos pos) { this.pos = pos; }
+ public FullDataPointIdMap(long pos) { this.pos = pos; }
@@ -123,7 +123,7 @@ public class FullDataPointIdMap
public boolean isEmpty() { return this.entryList.isEmpty(); }
- public DhSectionPos getPos() { return this.pos; }
+ public long getPos() { return this.pos; }
@@ -270,7 +270,7 @@ public class FullDataPointIdMap
}
/** Should only be used if this map is going to be reused, otherwise bad things will happen. */
- public void clear(DhSectionPos pos)
+ public void clear(long pos)
{
this.pos = pos;
this.entryList.clear();
@@ -321,7 +321,7 @@ public class FullDataPointIdMap
}
/** Creates a new IdBiomeBlockStateMap from the given UTF formatted stream */
- public static FullDataPointIdMap deserialize(DhDataInputStream inputStream, DhSectionPos pos, ILevelWrapper levelWrapper) throws IOException, InterruptedException, DataCorruptedException
+ public static FullDataPointIdMap deserialize(DhDataInputStream inputStream, long pos, ILevelWrapper levelWrapper) throws IOException, InterruptedException, DataCorruptedException
{
int entityCount = inputStream.readInt();
if (entityCount < 0)
@@ -361,12 +361,10 @@ public class FullDataPointIdMap
}
}
- //LOGGER.trace("deserialized " + pos + " " + newMap.entryList.size() + "-" + entityCount);
-
if (newMap.size() != entityCount)
{
// if the mappings are out of sync then the LODs will render incorrectly due to IDs being wrong
- LodUtil.assertNotReach("ID maps failed to deserialize for pos: "+pos+", incorrect entity count. Expected count ["+entityCount+"], actual count ["+newMap.size()+"]");
+ LodUtil.assertNotReach("ID maps failed to deserialize for pos: ["+ DhSectionPos.toString(pos)+"], incorrect entity count. Expected count ["+entityCount+"], actual count ["+newMap.size()+"]");
}
return newMap;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/FullDataSourceV1.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/FullDataSourceV1.java
index 4f782837b..bc82aa94a 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/FullDataSourceV1.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/FullDataSourceV1.java
@@ -75,7 +75,7 @@ public class FullDataSourceV1 implements IDataSource
/** A flattened 2D array (for the X and Z directions) containing an array for the Y direction. */
private final long[][] dataArrays;
- private DhSectionPos sectionPos;
+ private long sectionPos;
private boolean isEmpty = true;
@@ -85,8 +85,8 @@ public class FullDataSourceV1 implements IDataSource
// constructors //
//==============//
- public static FullDataSourceV1 createEmpty(DhSectionPos pos) { return new FullDataSourceV1(pos); }
- private FullDataSourceV1(DhSectionPos sectionPos)
+ public static FullDataSourceV1 createEmpty(long pos) { return new FullDataSourceV1(pos); }
+ private FullDataSourceV1(long sectionPos)
{
this.dataArrays = new long[WIDTH * WIDTH][0];
this.mapping = new FullDataPointIdMap(sectionPos);
@@ -111,19 +111,19 @@ public class FullDataSourceV1 implements IDataSource
//=====================//
@Override
- public DhSectionPos getKey() { return this.sectionPos; }
+ public Long getKey() { return this.sectionPos; }
@Override
- public DhSectionPos getPos() { return this.sectionPos; }
+ public Long getPos() { return this.sectionPos; }
- public void resizeDataStructuresForRepopulation(DhSectionPos pos)
+ public void resizeDataStructuresForRepopulation(long pos)
{
// no data structures need to be changed, only the source's position
this.sectionPos = pos;
}
@Override
- public byte getDataDetailLevel() { return (byte) (this.sectionPos.getDetailLevel() - SECTION_SIZE_OFFSET); }
+ public byte getDataDetailLevel() { return (byte) (DhSectionPos.getDetailLevel(this.sectionPos) - SECTION_SIZE_OFFSET); }
public boolean isEmpty() { return this.isEmpty; }
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/FullDataSourceV2.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/FullDataSourceV2.java
index 632d0722a..f9ba72d0d 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/FullDataSourceV2.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/fullData/sources/FullDataSourceV2.java
@@ -71,9 +71,9 @@ public class FullDataSourceV2 implements IDataSource
private int cachedHashCode = 0;
- private DhSectionPos pos;
+ private long pos;
@Override
- public DhSectionPos getKey() { return this.pos; }
+ public Long getKey() { return this.pos; }
public final FullDataPointIdMap mapping;
@@ -114,8 +114,8 @@ public class FullDataSourceV2 implements IDataSource
// constructors //
//==============//
- public static FullDataSourceV2 createEmpty(DhSectionPos pos) { return new FullDataSourceV2(pos); }
- private FullDataSourceV2(DhSectionPos pos)
+ public static FullDataSourceV2 createEmpty(long pos) { return new FullDataSourceV2(pos); }
+ private FullDataSourceV2(long pos)
{
this.pos = pos;
this.dataPoints = new LongArrayList[WIDTH * WIDTH];
@@ -128,8 +128,8 @@ public class FullDataSourceV2 implements IDataSource
this.columnWorldCompressionMode = new byte[WIDTH * WIDTH];
}
- public static FullDataSourceV2 createWithData(DhSectionPos pos, FullDataPointIdMap mapping, LongArrayList[] data, byte[] columnGenerationStep, byte[] columnWorldCompressionMode) { return new FullDataSourceV2(pos, mapping, data, columnGenerationStep, columnWorldCompressionMode); }
- private FullDataSourceV2(DhSectionPos pos, FullDataPointIdMap mapping, LongArrayList[] data, byte[] columnGenerationSteps, byte[] columnWorldCompressionMode)
+ public static FullDataSourceV2 createWithData(long pos, FullDataPointIdMap mapping, LongArrayList[] data, byte[] columnGenerationStep, byte[] columnWorldCompressionMode) { return new FullDataSourceV2(pos, mapping, data, columnGenerationStep, columnWorldCompressionMode); }
+ private FullDataSourceV2(long pos, FullDataPointIdMap mapping, LongArrayList[] data, byte[] columnGenerationSteps, byte[] columnWorldCompressionMode)
{
LodUtil.assertTrue(data.length == WIDTH * WIDTH);
@@ -232,8 +232,8 @@ public class FullDataSourceV2 implements IDataSource
}
- byte thisDetailLevel = this.pos.getDetailLevel();
- byte inputDetailLevel = inputDataSource.pos.getDetailLevel();
+ byte thisDetailLevel = DhSectionPos.getDetailLevel(this.pos);
+ byte inputDetailLevel = DhSectionPos.getDetailLevel(inputDataSource.pos);
// determine the mapping changes necessary for the input to map onto this datasource
@@ -258,7 +258,7 @@ public class FullDataSourceV2 implements IDataSource
}
// determine if this data source should be applied to its parent
- this.applyToParent = (dataChanged && this.pos.getDetailLevel() < AbstractDataSourceHandler.TOP_SECTION_DETAIL_LEVEL);
+ this.applyToParent = (dataChanged && DhSectionPos.getDetailLevel(this.pos) < AbstractDataSourceHandler.TOP_SECTION_DETAIL_LEVEL);
if (dataChanged)
{
@@ -271,9 +271,9 @@ public class FullDataSourceV2 implements IDataSource
public boolean updateFromSameDetailLevel(FullDataSourceV2 inputDataSource, int[] remappedIds)
{
// both data sources should have the same detail level
- if (inputDataSource.pos.getDetailLevel() != this.pos.getDetailLevel())
+ if (DhSectionPos.getDetailLevel(inputDataSource.pos) != DhSectionPos.getDetailLevel(this.pos))
{
- throw new IllegalArgumentException("Both data sources must have the same detail level. Expected [" + this.pos.getDetailLevel() + "], received [" + inputDataSource.pos.getDetailLevel() + "].");
+ throw new IllegalArgumentException("Both data sources must have the same detail level. Expected ["+ DhSectionPos.getDetailLevel(this.pos)+"], received ["+ DhSectionPos.getDetailLevel(inputDataSource.pos)+"].");
}
// copy over everything from the input data source into this one
@@ -353,9 +353,9 @@ public class FullDataSourceV2 implements IDataSource
}
public boolean updateFromOneBelowDetailLevel(FullDataSourceV2 inputDataSource, int[] remappedIds)
{
- if (inputDataSource.pos.getDetailLevel() + 1 != this.pos.getDetailLevel())
+ if (DhSectionPos.getDetailLevel(inputDataSource.pos) + 1 != DhSectionPos.getDetailLevel(this.pos))
{
- throw new IllegalArgumentException("Input data source must be exactly 1 detail level below this data source. Expected [" + (this.pos.getDetailLevel() - 1) + "], received [" + inputDataSource.pos.getDetailLevel() + "].");
+ throw new IllegalArgumentException("Input data source must be exactly 1 detail level below this data source. Expected [" + (DhSectionPos.getDetailLevel(this.pos) - 1) + "], received [" + DhSectionPos.getDetailLevel(inputDataSource.pos) + "].");
}
// input is one detail level lower (higher detail)
@@ -364,10 +364,10 @@ public class FullDataSourceV2 implements IDataSource
// determine where in the input data source should be written to
// since the input is one detail level below it will be one of this position's 4 children
- int minChildXPos = this.pos.getChildByIndex(0).getX();
- int recipientOffsetX = (inputDataSource.pos.getX() == minChildXPos) ? 0 : (WIDTH / 2);
- int minChildZPos = this.pos.getChildByIndex(0).getZ();
- int recipientOffsetZ = (inputDataSource.pos.getZ() == minChildZPos) ? 0 : (WIDTH / 2);
+ int minChildXPos = DhSectionPos.getX(DhSectionPos.getChildByIndex(this.pos, 0));
+ int recipientOffsetX = (DhSectionPos.getX(inputDataSource.pos) == minChildXPos) ? 0 : (WIDTH / 2);
+ int minChildZPos = DhSectionPos.getZ(DhSectionPos.getChildByIndex(this.pos, 0));
+ int recipientOffsetZ = (DhSectionPos.getZ(inputDataSource.pos) == minChildZPos) ? 0 : (WIDTH / 2);
@@ -801,7 +801,7 @@ public class FullDataSourceV2 implements IDataSource
*
* @see FullDataSourceV2#dataPoints
*/
- public static void throwIfDataColumnInWrongOrder(DhSectionPos pos, LongArrayList dataArray) throws IllegalStateException
+ public static void throwIfDataColumnInWrongOrder(long pos, LongArrayList dataArray) throws IllegalStateException
{
long firstDataPoint = dataArray.getLong(0);
int firstBottomY = FullDataPointUtil.getBottomY(firstDataPoint);
@@ -811,7 +811,7 @@ public class FullDataSourceV2 implements IDataSource
if (firstBottomY < lastBottomY)
{
- throw new IllegalStateException("Incorrect data point order at pos: " + pos + ", first datapoint bottom Y [" + firstBottomY + "], last datapoint bottom Y [" + lastBottomY + "].");
+ throw new IllegalStateException("Incorrect data point order at pos: ["+ DhSectionPos.toString(pos)+"], first datapoint bottom Y ["+firstBottomY+"], last datapoint bottom Y ["+lastBottomY+"].");
}
}
@@ -847,7 +847,7 @@ public class FullDataSourceV2 implements IDataSource
// pooling //
//=========//
- private static void prepPooledDataSource(DhSectionPos pos, boolean clearData, FullDataSourceV2 dataSource)
+ private static void prepPooledDataSource(long pos, boolean clearData, FullDataSourceV2 dataSource)
{
dataSource.pos = pos;
@@ -875,10 +875,10 @@ public class FullDataSourceV2 implements IDataSource
//=====================//
@Override
- public DhSectionPos getPos() { return this.pos; }
+ public Long getPos() { return this.pos; }
@Override
- public byte getDataDetailLevel() { return (byte) (this.pos.getDetailLevel() - DhSectionPos.SECTION_MINIMUM_DETAIL_LEVEL); }
+ public byte getDataDetailLevel() { return (byte) (DhSectionPos.getDetailLevel(this.pos) - DhSectionPos.SECTION_MINIMUM_DETAIL_LEVEL); }
public EDhApiWorldGenerationStep getWorldGenStepAtRelativePos(int relX, int relZ)
{
@@ -917,7 +917,7 @@ public class FullDataSourceV2 implements IDataSource
//================//
@Override
- public String toString() { return this.pos.toString(); }
+ public String toString() { return DhSectionPos.toString(this.pos); }
@Override
public int hashCode()
@@ -930,7 +930,7 @@ public class FullDataSourceV2 implements IDataSource
}
private void generateHashCode()
{
- int result = this.pos.hashCode();
+ int result = DhSectionPos.hashCode(this.pos);
result = 31 * result + Arrays.deepHashCode(this.dataPoints);
result = 17 * result + Arrays.hashCode(this.columnGenerationSteps);
result = 43 * result + Arrays.hashCode(this.columnWorldCompressionMode);
@@ -947,7 +947,7 @@ public class FullDataSourceV2 implements IDataSource
}
FullDataSourceV2 other = (FullDataSourceV2) obj;
- if (!other.pos.equals(this.pos))
+ if (other.pos != this.pos)
{
return false;
}
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/ColumnRenderSource.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/ColumnRenderSource.java
index 453f5b490..92626cbdb 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/ColumnRenderSource.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/ColumnRenderSource.java
@@ -59,7 +59,7 @@ public class ColumnRenderSource implements IDataSource
/** will be zero if an empty data source was created */
public int verticalDataCount;
- public DhSectionPos pos;
+ public long pos;
public int yOffset;
public LongArrayList renderDataContainer;
@@ -77,11 +77,11 @@ public class ColumnRenderSource implements IDataSource
//==============//
/**
- * This is separate from {@link DataSourcePool#getPooledSource(DhSectionPos, boolean)}
+ * This is separate from {@link DataSourcePool#getPooledSource(long, boolean)}
* because we need to pass in a couple extra values,
* specifically maxVerticalSize and yOffset.
*/
- public static ColumnRenderSource getPooledRenderSource(DhSectionPos pos, int maxVerticalSize, int yOffset, boolean clearData)
+ public static ColumnRenderSource getPooledRenderSource(long pos, int maxVerticalSize, int yOffset, boolean clearData)
{
ColumnRenderSource renderSource = DATA_SOURCE_POOL.getPooledSource(pos);
@@ -109,14 +109,14 @@ public class ColumnRenderSource implements IDataSource
}
- private static ColumnRenderSource createEmptyRenderSource(DhSectionPos sectionPos) { return new ColumnRenderSource(sectionPos, 0, 0); }
+ private static ColumnRenderSource createEmptyRenderSource(long sectionPos) { return new ColumnRenderSource(sectionPos, 0, 0); }
/**
* Creates an empty ColumnRenderSource.
*
* @param pos the relative position of the container
* @param maxVerticalSize the maximum vertical size of the container
*/
- private ColumnRenderSource(DhSectionPos pos, int maxVerticalSize, int yOffset)
+ private ColumnRenderSource(long pos, int maxVerticalSize, int yOffset)
{
this.verticalDataCount = maxVerticalSize;
this.renderDataContainer = new LongArrayList(new long[SECTION_SIZE * SECTION_SIZE * this.verticalDataCount]);
@@ -155,7 +155,7 @@ public class ColumnRenderSource implements IDataSource
final String errorMessagePrefix = "Unable to complete update for RenderSource pos: [" + this.pos + "] and pos: [" + inputFullDataSource.getPos() + "]. Error:";
boolean dataChanged = false;
- if (inputFullDataSource.getPos().getDetailLevel() == this.pos.getDetailLevel())
+ if (DhSectionPos.getDetailLevel(inputFullDataSource.getPos()) == DhSectionPos.getDetailLevel(this.pos))
{
try
{
@@ -167,8 +167,8 @@ public class ColumnRenderSource implements IDataSource
- DhBlockPos2D centerBlockPos = inputFullDataSource.getPos().getCenterBlockPos();
- int halfBlockWidth = inputFullDataSource.getPos().getBlockWidth() / 2;
+ DhBlockPos2D centerBlockPos = DhSectionPos.getCenterBlockPos(inputFullDataSource.getPos());
+ int halfBlockWidth = DhSectionPos.getBlockWidth(inputFullDataSource.getPos()) / 2;
DhBlockPos2D minBlockPos = new DhBlockPos2D(centerBlockPos.x - halfBlockWidth, centerBlockPos.z - halfBlockWidth);
for (int x = 0; x < FullDataSourceV2.WIDTH; x++)
@@ -215,11 +215,11 @@ public class ColumnRenderSource implements IDataSource
// data helper methods //
//=====================//
- public DhSectionPos getPos() { return this.pos; }
+ public Long getPos() { return this.pos; }
@Override
- public DhSectionPos getKey() { return this.pos; }
+ public Long getKey() { return this.pos; }
- public byte getDataDetailLevel() { return (byte) (this.pos.getDetailLevel() - SECTION_SIZE_OFFSET); }
+ public byte getDataDetailLevel() { return (byte) (DhSectionPos.getDetailLevel(this.pos) - SECTION_SIZE_OFFSET); }
public boolean isEmpty() { return this.isEmpty; }
public void markNotEmpty() { this.isEmpty = false; }
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/ColumnRenderBuffer.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/ColumnRenderBuffer.java
index 05eb3b340..755b6b91c 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/ColumnRenderBuffer.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/ColumnRenderBuffer.java
@@ -343,17 +343,24 @@ public class ColumnRenderBuffer implements AutoCloseable
//==============//
/** can be used when debugging */
- public boolean hasNonEmptyBuffers()
+ public boolean hasNonNullVbos() { return this.vbos != null || this.vbosTransparent != null; }
+
+ /** can be used when debugging */
+ public int vboBufferCount()
{
- for (GLVertexBuffer vertexBuffer : this.vbos)
+ int count = 0;
+
+ if (this.vbos != null)
{
- if (vertexBuffer != null && vertexBuffer.getSize() != 0)
- {
- return true;
- }
+ count += this.vbos.length;
}
- return false;
+ if (this.vbosTransparent != null)
+ {
+ count += this.vbosTransparent.length;
+ }
+
+ return count;
}
public void debugDumpStats(StatsMap statsMap)
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/ColumnRenderBufferBuilder.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/ColumnRenderBufferBuilder.java
index aad029d2b..02c064408 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/ColumnRenderBufferBuilder.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/ColumnRenderBufferBuilder.java
@@ -98,7 +98,7 @@ public class ColumnRenderBufferBuilder
&& !clientLevel.getLevelWrapper().getDimensionType().isTheEnd()
// FIXME temporary fix
// Cave culling is currently broken for any detail level above 0
- && renderSource.pos.getDetailLevel() == DhSectionPos.SECTION_MINIMUM_DETAIL_LEVEL
+ && DhSectionPos.getDetailLevel(renderSource.pos) == DhSectionPos.SECTION_MINIMUM_DETAIL_LEVEL
);
int skyLightCullingBelow = Config.Client.Advanced.Graphics.AdvancedGraphics.caveCullingHeight.get();
@@ -131,7 +131,7 @@ public class ColumnRenderBufferBuilder
{
try
{
- ColumnRenderBuffer buffer = new ColumnRenderBuffer(new DhBlockPos(renderSource.pos.getMinCornerLodPos().getCornerBlockPos(), clientLevel.getMinY()));
+ ColumnRenderBuffer buffer = new ColumnRenderBuffer(new DhBlockPos(DhSectionPos.getMinCornerBlockX(renderSource.pos), clientLevel.getMinY(), DhSectionPos.getMinCornerBlockZ(renderSource.pos)));
try
{
buffer.uploadBuffer(quadBuilder, GLProxy.getInstance().getGpuUploadMethod());
@@ -174,9 +174,9 @@ public class ColumnRenderBufferBuilder
boolean enableColumnBufferLimit = Config.Client.Advanced.Debugging.columnBuilderDebugEnable.get();
if (enableColumnBufferLimit)
{
- if (renderSource.pos.getDetailLevel() == Config.Client.Advanced.Debugging.columnBuilderDebugDetailLevel.get()
- && renderSource.pos.getX() == Config.Client.Advanced.Debugging.columnBuilderDebugXPos.get()
- && renderSource.pos.getZ() == Config.Client.Advanced.Debugging.columnBuilderDebugZPos.get())
+ if (DhSectionPos.getDetailLevel(renderSource.pos) == Config.Client.Advanced.Debugging.columnBuilderDebugDetailLevel.get()
+ && DhSectionPos.getX(renderSource.pos) == Config.Client.Advanced.Debugging.columnBuilderDebugXPos.get()
+ && DhSectionPos.getZ(renderSource.pos) == Config.Client.Advanced.Debugging.columnBuilderDebugZPos.get())
{
int test = 0;
}
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/columnViews/IColumnDataView.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/columnViews/IColumnDataView.java
index 825824162..2d97e9426 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/columnViews/IColumnDataView.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/columnViews/IColumnDataView.java
@@ -19,6 +19,8 @@
package com.seibel.distanthorizons.core.dataObjects.render.columnViews;
+import it.unimi.dsi.fastutil.longs.LongIterator;
+
import java.util.Iterator;
public interface IColumnDataView
@@ -28,18 +30,18 @@ public interface IColumnDataView
// FIXME probably horizontal size in blocks?
int size();
- default Iterator iterator()
+ default LongIterator iterator()
{
- return new Iterator()
+ return new LongIterator()
{
private int index = 0;
- private final int size = size();
+ private final int size = IColumnDataView.this.size();
@Override
public boolean hasNext() { return this.index < this.size; }
@Override
- public Long next() { return get(this.index++); }
+ public long nextLong() { return IColumnDataView.this.get(this.index++); }
};
}
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/FullDataToRenderDataTransformer.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/FullDataToRenderDataTransformer.java
index f66e26262..3f0e29f52 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/FullDataToRenderDataTransformer.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/FullDataToRenderDataTransformer.java
@@ -38,6 +38,7 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.block.IBlockStateWrappe
import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftClientWrapper;
import com.seibel.distanthorizons.core.wrapperInterfaces.world.IBiomeWrapper;
import it.unimi.dsi.fastutil.longs.LongArrayList;
+import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
import org.apache.logging.log4j.Logger;
import java.util.HashSet;
@@ -52,7 +53,7 @@ public class FullDataToRenderDataTransformer
private static final IWrapperFactory WRAPPER_FACTORY = SingletonInjector.INSTANCE.get(IWrapperFactory.class);
private static final IMinecraftClientWrapper MC = SingletonInjector.INSTANCE.get(IMinecraftClientWrapper.class);
- private static final HashSet brokenPos = new HashSet<>();
+ private static final LongOpenHashSet brokenPos = new LongOpenHashSet();
@@ -98,7 +99,7 @@ public class FullDataToRenderDataTransformer
*/
private static ColumnRenderSource transformCompleteFullDataToColumnData(IDhClientLevel level, FullDataSourceV2 fullDataSource) throws InterruptedException
{
- final DhSectionPos pos = fullDataSource.getPos();
+ final long pos = fullDataSource.getPos();
final byte dataDetail = fullDataSource.getDataDetailLevel();
final int vertSize = Config.Client.Advanced.Graphics.Quality.verticalQuality.get().calculateMaxVerticalData(fullDataSource.getDataDetailLevel());
final ColumnRenderSource columnSource = ColumnRenderSource.getPooledRenderSource(pos, vertSize, level.getMinY(), true);
@@ -111,12 +112,12 @@ public class FullDataToRenderDataTransformer
if (dataDetail == columnSource.getDataDetailLevel())
{
- int baseX = pos.getMinCornerLodPos().getCornerBlockPos().x;
- int baseZ = pos.getMinCornerLodPos().getCornerBlockPos().z;
+ int baseX = DhSectionPos.getMinCornerBlockX(pos);
+ int baseZ = DhSectionPos.getMinCornerBlockZ(pos);
- for (int x = 0; x < pos.getWidthCountForLowerDetailedSection(dataDetail); x++)
+ for (int x = 0; x < DhSectionPos.getWidthCountForLowerDetailedSection(pos, dataDetail); x++)
{
- for (int z = 0; z < pos.getWidthCountForLowerDetailedSection(dataDetail); z++)
+ for (int z = 0; z < DhSectionPos.getWidthCountForLowerDetailedSection(pos, dataDetail); z++)
{
throwIfThreadInterrupted();
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/LodDataBuilder.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/LodDataBuilder.java
index bc6da58f6..5f3001621 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/LodDataBuilder.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/transformers/LodDataBuilder.java
@@ -73,7 +73,7 @@ public class LodDataBuilder
sectionPosX = (sectionPosX < 0) ? ((sectionPosX + 1) / NUMB_OF_CHUNKS_WIDE) - 1 : (sectionPosX / NUMB_OF_CHUNKS_WIDE);
int sectionPosZ = chunkWrapper.getChunkPos().z;
sectionPosZ = (sectionPosZ < 0) ? ((sectionPosZ + 1) / NUMB_OF_CHUNKS_WIDE) - 1 : (sectionPosZ / NUMB_OF_CHUNKS_WIDE);
- DhSectionPos pos = new DhSectionPos(DhSectionPos.SECTION_BLOCK_DETAIL_LEVEL, sectionPosX, sectionPosZ);
+ long pos = DhSectionPos.encode(DhSectionPos.SECTION_BLOCK_DETAIL_LEVEL, sectionPosX, sectionPosZ);
FullDataSourceV2 dataSource = FullDataSourceV2.createEmpty(pos);
dataSource.isEmpty = false;
@@ -303,7 +303,7 @@ public class LodDataBuilder
/** @throws ClassCastException if an API user returns the wrong object type(s) */
public static FullDataSourceV2 createFromApiChunkData(DhApiChunk dataPoints) throws ClassCastException, DataCorruptedException
{
- FullDataSourceV2 accessor = FullDataSourceV2.createEmpty(new DhSectionPos(new DhChunkPos(dataPoints.chunkPosX, dataPoints.chunkPosZ)));
+ FullDataSourceV2 accessor = FullDataSourceV2.createEmpty(DhSectionPos.encode(new DhChunkPos(dataPoints.chunkPosX, dataPoints.chunkPosZ)));
for (int relZ = 0; relZ < LodUtil.CHUNK_WIDTH; relZ++)
{
for (int relX = 0; relX < LodUtil.CHUNK_WIDTH; relX++)
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/enums/EDhDirection.java b/core/src/main/java/com/seibel/distanthorizons/core/enums/EDhDirection.java
index 46446cf10..ff7cebd50 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/enums/EDhDirection.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/enums/EDhDirection.java
@@ -43,11 +43,17 @@ import com.seibel.distanthorizons.coreapi.util.math.Vec3i;
*/
public enum EDhDirection
{
+ /** negative Y */
DOWN(0, 1, -1, "down", EDhDirection.AxisDirection.NEGATIVE, EDhDirection.Axis.Y, new Vec3i(0, -1, 0)),
+ /** positive Y */
UP(1, 0, -1, "up", EDhDirection.AxisDirection.POSITIVE, EDhDirection.Axis.Y, new Vec3i(0, 1, 0)),
+ /** negative Z */
NORTH(2, 3, 2, "north", EDhDirection.AxisDirection.NEGATIVE, EDhDirection.Axis.Z, new Vec3i(0, 0, -1)),
+ /** positive Z */
SOUTH(3, 2, 0, "south", EDhDirection.AxisDirection.POSITIVE, EDhDirection.Axis.Z, new Vec3i(0, 0, 1)),
+ /** negative X */
WEST(4, 5, 1, "west", EDhDirection.AxisDirection.NEGATIVE, EDhDirection.Axis.X, new Vec3i(-1, 0, 0)),
+ /** positive X */
EAST(5, 4, 3, "east", EDhDirection.AxisDirection.POSITIVE, EDhDirection.Axis.X, new Vec3i(1, 0, 0));
/**
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/AbstractDataSourceHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/file/AbstractDataSourceHandler.java
index 96ed0902c..f78a8f7a4 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/file/AbstractDataSourceHandler.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/file/AbstractDataSourceHandler.java
@@ -17,7 +17,6 @@ import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.io.IOException;
-import java.io.StreamCorruptedException;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
@@ -27,8 +26,8 @@ import java.util.concurrent.locks.ReentrantLock;
// We shouldn't need multiple data source handlers
public abstract class AbstractDataSourceHandler
,
- TDTO extends IBaseDTO,
- TRepo extends AbstractDhRepo,
+ TDTO extends IBaseDTO,
+ TRepo extends AbstractDhRepo,
TDhLevel extends IDhLevel>
implements AutoCloseable
{
@@ -56,8 +55,8 @@ public abstract class AbstractDataSourceHandler
* generally just used for debugging,
* keeps track of which positions are currently locked.
*/
- public final Set lockedPosSet = ConcurrentHashMap.newKeySet();
- public final ConcurrentHashMap queuedUpdateCountsByPos = new ConcurrentHashMap<>();
+ public final Set lockedPosSet = ConcurrentHashMap.newKeySet();
+ public final ConcurrentHashMap queuedUpdateCountsByPos = new ConcurrentHashMap<>();
protected final ReentrantLock closeLock = new ReentrantLock();
@@ -102,7 +101,7 @@ public abstract class AbstractDataSourceHandler
protected abstract TDataSource createDataSourceFromDto(TDTO dto) throws InterruptedException, IOException, DataCorruptedException;
protected abstract TDTO createDtoFromDataSource(TDataSource dataSource);
- protected abstract TDataSource makeEmptyDataSource(DhSectionPos pos);
+ protected abstract TDataSource makeEmptyDataSource(long pos);
@@ -116,7 +115,7 @@ public abstract class AbstractDataSourceHandler
*
* This call is concurrent. I.e. it supports being called by multiple threads at the same time.
*/
- public CompletableFuture getAsync(DhSectionPos pos)
+ public CompletableFuture getAsync(long pos)
{
ThreadPoolExecutor executor = ThreadPoolUtil.getFileHandlerExecutor();
if (executor == null || executor.isTerminated())
@@ -138,10 +137,10 @@ public abstract class AbstractDataSourceHandler
/**
* Should only be used in internal file handler methods where we are already running on a file handler thread.
* Can return null if the repo is in the process of being shut down
- * @see AbstractDataSourceHandler#getAsync(DhSectionPos)
+ * @see AbstractDataSourceHandler#getAsync(long)
*/
@Nullable
- public TDataSource get(DhSectionPos pos)
+ public TDataSource get(long pos)
{
TDataSource dataSource = null;
try
@@ -161,7 +160,7 @@ public abstract class AbstractDataSourceHandler
// if the user is migrating from a nightly build and used ZStd.
if (CORRUPT_DATA_ERRORS_LOGGED.add(e.getMessage()))
{
- LOGGER.warn("Corrupted data found at pos " + pos + ". Data at position will be deleted so it can be re-generated to prevent issues. Future errors with this same message won't be logged. Error: " + e.getMessage(), e);
+ LOGGER.warn("Corrupted data found at pos [" + DhSectionPos.toString(pos) + "]. Data at position will be deleted so it can be re-generated to prevent issues. Future errors with this same message won't be logged. Error: " + e.getMessage(), e);
}
this.repo.deleteWithKey(pos);
@@ -178,7 +177,7 @@ public abstract class AbstractDataSourceHandler
catch (InterruptedException ignore) { }
catch (IOException e)
{
- LOGGER.warn("File read Error for pos ["+pos+"], error: "+e.getMessage(), e);
+ LOGGER.warn("File read Error for pos ["+ DhSectionPos.toString(pos)+"], error: "+e.getMessage(), e);
}
return dataSource;
@@ -232,7 +231,7 @@ public abstract class AbstractDataSourceHandler
*
* @param updatePos the position to update
*/
- protected void updateDataSourceAtPos(DhSectionPos updatePos, @NotNull FullDataSourceV2 inputData, boolean lockOnUpdatePos)
+ protected void updateDataSourceAtPos(long updatePos, @NotNull FullDataSourceV2 inputData, boolean lockOnUpdatePos)
{
boolean methodLocked = false;
// a lock is necessary to prevent two threads from writing to the same position at once,
@@ -294,7 +293,7 @@ public abstract class AbstractDataSourceHandler
//================//
/** used for debugging to track which positions are queued for updating */
- private void markUpdateStart(DhSectionPos dataSourcePos)
+ private void markUpdateStart(long dataSourcePos)
{
this.queuedUpdateCountsByPos.compute(dataSourcePos, (pos, atomicCount) ->
{
@@ -307,7 +306,7 @@ public abstract class AbstractDataSourceHandler
});
}
/** used for debugging to track which positions are queued for updating */
- private void markUpdateEnd(DhSectionPos dataSourcePos)
+ private void markUpdateEnd(long dataSourcePos)
{
this.queuedUpdateCountsByPos.compute(dataSourcePos, (pos, atomicCount) ->
{
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/DataSourcePool.java b/core/src/main/java/com/seibel/distanthorizons/core/file/DataSourcePool.java
index fa6b80fdf..cd8da6f4b 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/file/DataSourcePool.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/file/DataSourcePool.java
@@ -1,8 +1,6 @@
package com.seibel.distanthorizons.core.file;
import com.seibel.distanthorizons.core.level.IDhLevel;
-import com.seibel.distanthorizons.core.pos.DhSectionPos;
-import com.seibel.distanthorizons.core.util.ThreadUtil;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
@@ -27,7 +25,7 @@ public class DataSourcePool, TDhLevel
private final ArrayList pooledDataSources = new ArrayList<>();
private final ReentrantLock poolLock = new ReentrantLock();
- private final Function createEmptyDatasourceFunc;
+ private final Function createEmptyDatasourceFunc;
@Nullable
private final IPrepPooledDataSourceFunc prepDatasourceFunc;
@@ -37,7 +35,7 @@ public class DataSourcePool, TDhLevel
// constructor //
//=============//
- public DataSourcePool(Function createEmptyDatasourceFunc, @Nullable IPrepPooledDataSourceFunc prepDatasourceFunc)
+ public DataSourcePool(Function createEmptyDatasourceFunc, @Nullable IPrepPooledDataSourceFunc prepDatasourceFunc)
{
this.createEmptyDatasourceFunc = createEmptyDatasourceFunc;
this.prepDatasourceFunc = prepDatasourceFunc;
@@ -51,12 +49,12 @@ public class DataSourcePool, TDhLevel
/**
* Returns a cleared data source.
- * @see DataSourcePool#getPooledSource(DhSectionPos, boolean)
+ * @see DataSourcePool#getPooledSource(long, boolean)
*/
- public TDataSource getPooledSource(DhSectionPos pos) { return this.getPooledSource(pos, true);}
+ public TDataSource getPooledSource(long pos) { return this.getPooledSource(pos, true);}
/** @return an empty data source if non are cached */
- public TDataSource getPooledSource(DhSectionPos pos, boolean clearData)
+ public TDataSource getPooledSource(long pos, boolean clearData)
{
try
{
@@ -133,7 +131,7 @@ public class DataSourcePool, TDhLevel
public interface IPrepPooledDataSourceFunc, TDhLevel extends IDhLevel>
{
/** @param clearData will be false if the data will be immediately overwritten anyway */
- void prepDataSource(DhSectionPos pos, boolean clearData, TDataSource dataSource);
+ void prepDataSource(long pos, boolean clearData, TDataSource dataSource);
}
}
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/IDataSource.java b/core/src/main/java/com/seibel/distanthorizons/core/file/IDataSource.java
index 09d4d4ee8..3b855e729 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/file/IDataSource.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/file/IDataSource.java
@@ -3,7 +3,6 @@ package com.seibel.distanthorizons.core.file;
import com.seibel.distanthorizons.api.enums.EDhApiDetailLevel;
import com.seibel.distanthorizons.core.dataObjects.fullData.sources.FullDataSourceV2;
import com.seibel.distanthorizons.core.level.IDhLevel;
-import com.seibel.distanthorizons.core.pos.DhSectionPos;
import com.seibel.distanthorizons.core.sql.dto.IBaseDTO;
/**
@@ -13,9 +12,9 @@ import com.seibel.distanthorizons.core.sql.dto.IBaseDTO;
*
* @param there are times when we need specifically a client level vs a more generic level
*/
-public interface IDataSource extends IBaseDTO, AutoCloseable
+public interface IDataSource extends IBaseDTO, AutoCloseable
{
- DhSectionPos getPos();
+ Long getPos();
/** @return true if the data was changed */
boolean update(FullDataSourceV2 chunkData, TDhLevel level);
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/DelayedFullDataSourceSaveCache.java b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/DelayedFullDataSourceSaveCache.java
index aa87662f8..e2efce4c7 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/DelayedFullDataSourceSaveCache.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/DelayedFullDataSourceSaveCache.java
@@ -2,7 +2,6 @@ package com.seibel.distanthorizons.core.file.fullDatafile;
import com.seibel.distanthorizons.core.dataObjects.fullData.sources.FullDataSourceV2;
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
-import com.seibel.distanthorizons.core.pos.DhSectionPos;
import com.seibel.distanthorizons.core.util.TimerUtil;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.NotNull;
@@ -22,8 +21,8 @@ public class DelayedFullDataSourceSaveCache
private static final Timer DELAY_UPDATE_TIMER = TimerUtil.CreateTimer("Delayed Full Datasource Save Timer");
- public final ConcurrentHashMap dataSourceByPosition = new ConcurrentHashMap<>();
- private final ConcurrentHashMap saveTimerTasksBySectionPos = new ConcurrentHashMap<>();
+ public final ConcurrentHashMap dataSourceByPosition = new ConcurrentHashMap<>();
+ private final ConcurrentHashMap saveTimerTasksBySectionPos = new ConcurrentHashMap<>();
private final ISaveDataSourceFunc onSaveTimeoutFunc;
private final int saveDelayInMs;
@@ -48,7 +47,7 @@ public class DelayedFullDataSourceSaveCache
public void queueDataSourceForUpdateAndSave(FullDataSourceV2 inputDataSource)
{
- DhSectionPos dataSourcePos = inputDataSource.getPos();
+ long dataSourcePos = inputDataSource.getPos();
this.dataSourceByPosition.compute(dataSourcePos, (inputPos, temporaryDataSource) ->
{
if (temporaryDataSource == null)
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataSourceProviderV1.java b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataSourceProviderV1.java
index 1ee291fcc..4c1e443fe 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataSourceProviderV1.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataSourceProviderV1.java
@@ -9,6 +9,7 @@ import com.seibel.distanthorizons.core.sql.dto.FullDataSourceV1DTO;
import com.seibel.distanthorizons.core.sql.repo.FullDataSourceV1Repo;
import com.seibel.distanthorizons.core.util.objects.DataCorruptedException;
import com.seibel.distanthorizons.core.util.threading.ThreadPoolUtil;
+import it.unimi.dsi.fastutil.longs.LongArrayList;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.Nullable;
@@ -92,7 +93,7 @@ public class FullDataSourceProviderV1
*
* This call is concurrent. I.e. it supports being called by multiple threads at the same time.
*/
- public CompletableFuture getAsync(DhSectionPos pos)
+ public CompletableFuture getAsync(long pos)
{
ThreadPoolExecutor executor = ThreadPoolUtil.getFileHandlerExecutor();
if (executor == null || executor.isTerminated())
@@ -113,10 +114,10 @@ public class FullDataSourceProviderV1
/**
* Should only be used in internal file handler methods where we are already running on a file handler thread.
* Can return null.
- * @see FullDataSourceProviderV1#getAsync(DhSectionPos)
+ * @see FullDataSourceProviderV1#getAsync(long)
*/
@Nullable
- public FullDataSourceV1 get(DhSectionPos pos)
+ public FullDataSourceV1 get(Long pos)
{
FullDataSourceV1 dataSource = null;
try
@@ -133,12 +134,12 @@ public class FullDataSourceProviderV1
{
// stack trace not included since a lot of corrupt data would cause the log to get quite messy,
// and it should be fairly easy to see what the problem was from the message
- LOGGER.warn("Corrupted data found at pos "+pos+". Data at position will be deleted so it can be re-generated and to prevent future issues. Error: "+e.getMessage());
+ LOGGER.warn("Corrupted data found at pos ["+ DhSectionPos.toString(pos)+"]. Data at position will be deleted so it can be re-generated and to prevent future issues. Error: "+e.getMessage());
this.repo.deleteWithKey(pos);
}
catch (IOException e)
{
- LOGGER.warn("File read Error for pos ["+pos+"], error: "+e.getMessage(), e);
+ LOGGER.warn("File read Error for pos ["+ DhSectionPos.toString(pos)+"], error: "+e.getMessage(), e);
}
return dataSource;
@@ -156,10 +157,10 @@ public class FullDataSourceProviderV1
{
ArrayList dataSourceList = new ArrayList<>();
- ArrayList migrationPosList = this.repo.getPositionsToMigrate(limit);
+ LongArrayList migrationPosList = this.repo.getPositionsToMigrate(limit);
for (int i = 0; i < migrationPosList.size(); i++)
{
- DhSectionPos pos = migrationPosList.get(i);
+ Long pos = migrationPosList.getLong(i);
FullDataSourceV1 dataSource = this.get(pos);
if (dataSource != null)
{
@@ -170,7 +171,7 @@ public class FullDataSourceProviderV1
return dataSourceList;
}
- public void markMigrationFailed(DhSectionPos pos) { ((FullDataSourceV1Repo) this.repo).markMigrationFailed(pos); }
+ public void markMigrationFailed(long pos) { ((FullDataSourceV1Repo) this.repo).markMigrationFailed(pos); }
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataSourceProviderV2.java b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataSourceProviderV2.java
index 9ee70f7c4..d5b4a5cf1 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataSourceProviderV2.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/file/fullDatafile/FullDataSourceProviderV2.java
@@ -38,6 +38,7 @@ import com.seibel.distanthorizons.core.util.ThreadUtil;
import com.seibel.distanthorizons.core.util.objects.DataCorruptedException;
import com.seibel.distanthorizons.core.util.threading.ThreadPoolUtil;
import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftClientWrapper;
+import it.unimi.dsi.fastutil.longs.LongArrayList;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.Nullable;
@@ -51,7 +52,6 @@ import java.util.List;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.ReentrantLock;
-import java.util.function.Function;
import java.util.stream.Collectors;
/**
@@ -100,7 +100,7 @@ public class FullDataSourceProviderV2
* Tracks which positions are currently being updated
* to prevent duplicate concurrent updates.
*/
- public final Set parentUpdatingPosSet = ConcurrentHashMap.newKeySet();
+ public final Set parentUpdatingPosSet = ConcurrentHashMap.newKeySet();
// TODO only run thread if modifications happened recently
/**
@@ -175,10 +175,10 @@ public class FullDataSourceProviderV2
{ return dto.createPooledDataSource(this.level.getLevelWrapper()); }
@Override
- protected FullDataSourceV2 makeEmptyDataSource(DhSectionPos pos) { return FullDataSourceV2.DATA_SOURCE_POOL.getPooledSource(pos, true); }
+ protected FullDataSourceV2 makeEmptyDataSource(long pos) { return FullDataSourceV2.DATA_SOURCE_POOL.getPooledSource(pos, true); }
@Nullable
- public Long getTimestampForPos(DhSectionPos pos)
+ public Long getTimestampForPos(long pos)
{
try
{
@@ -189,9 +189,9 @@ public class FullDataSourceProviderV2
"AND PosX = ? " +
"AND PosZ = ?;"
);
- preparedStatement.setInt(1, pos.getDetailLevel() - DhSectionPos.SECTION_MINIMUM_DETAIL_LEVEL);
- preparedStatement.setInt(2, pos.getX());
- preparedStatement.setInt(3, pos.getZ());
+ preparedStatement.setInt(1, DhSectionPos.getDetailLevel(pos) - DhSectionPos.SECTION_MINIMUM_DETAIL_LEVEL);
+ preparedStatement.setInt(2, DhSectionPos.getX(pos));
+ preparedStatement.setInt(3, DhSectionPos.getZ(pos));
List