diff --git a/.gitignore b/.gitignore
index 42889b9cc..eeff2dc36 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,3 +27,6 @@ forge*changelog.txt
# Sqlite databases
*.sqlite
+*.sqlite-journal
+*.sqlite-shm
+*.sqlite-wal
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EBufferRebuildTimes.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EBufferRebuildTimes.java
deleted file mode 100644
index b34c005c7..000000000
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EBufferRebuildTimes.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2023 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.distanthorizons.api.enums.config;
-
-/**
- * CONSTANT
- * FREQUENT
- * NORMAL
- * RARE
- *
- * Determines how fast the buffers should be regenerated
- *
- * @author Leonardo Amato
- * @version 9-25-2021
- */
-@Deprecated // not currently in use, if the config this enum represents is re-implemented, the deprecated flag can be removed
-public enum EBufferRebuildTimes
-{
- CONSTANT(0, 0, 0, 1),
-
- FREQUENT(1000, 500, 2500, 1),
-
- NORMAL(2000, 1000, 5000, 4),
-
- RARE(5000, 2000, 10000, 16);
-
- public final int playerMoveTimeout;
- public final int renderedChunkTimeout;
- public final int chunkChangeTimeout;
- public final int playerMoveDistance;
-
- EBufferRebuildTimes(int playerMoveTimeout, int renderedChunkTimeout, int chunkChangeTimeout, int playerMoveDistance)
- {
- this.playerMoveTimeout = playerMoveTimeout;
- this.renderedChunkTimeout = renderedChunkTimeout;
- this.chunkChangeTimeout = chunkChangeTimeout;
- this.playerMoveDistance = playerMoveDistance;
- }
-}
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EBlocksToAvoid.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiBlocksToAvoid.java
similarity index 87%
rename from api/src/main/java/com/seibel/distanthorizons/api/enums/config/EBlocksToAvoid.java
rename to api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiBlocksToAvoid.java
index 2f26d3d71..92388135d 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EBlocksToAvoid.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiBlocksToAvoid.java
@@ -23,9 +23,10 @@ package com.seibel.distanthorizons.api.enums.config;
* NONE,
* NON_COLLIDING,
*
- * @since API 1.0.0
+ * @since API 1.1.0
+ * @version 2024-4-6
*/
-public enum EBlocksToAvoid
+public enum EDhApiBlocksToAvoid
{
// Reminder:
// when adding items up the API minor version
@@ -36,6 +37,6 @@ public enum EBlocksToAvoid
public final boolean noCollision;
- EBlocksToAvoid(boolean noCollision) { this.noCollision = noCollision; }
+ EDhApiBlocksToAvoid(boolean noCollision) { this.noCollision = noCollision; }
}
\ No newline at end of file
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
new file mode 100644
index 000000000..ce277088c
--- /dev/null
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiDataCompressionMode.java
@@ -0,0 +1,100 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 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.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
+ */
+public enum EDhApiDataCompressionMode
+{
+ // Reminder:
+ // when adding items up the API minor version
+ // when removing items up the API major version
+
+ /**
+ * Should only be used internally and for unit testing.
+ *
+ * Read Speed: 1.64 MS / DTO
+ * Write Speed: 12.44 MS / DTO
+ * Compression ratio: 1.0
+ */
+ @DisallowSelectingViaConfigGui
+ UNCOMPRESSED(0),
+
+ /**
+ * Extremely fast (often faster than uncompressed), but generally poor compression.
+ *
+ * Read Speed: 1.85 MS / DTO
+ * Write Speed: 9.46 MS / DTO
+ * Compression ratio: 0.3638
+ */
+ LZ4(1),
+
+ /**
+ * Decent speed and good compression.
+ *
+ * Read Speed: 11.78 MS / DTO
+ * Write Speed: 16.76 MS / DTO
+ * Compression ratio: 0.2199
+ */
+ Z_STD(2),
+
+ /**
+ * Extremely slow, but very good compression.
+ *
+ * Read Speed: 12.25 MS / DTO
+ * Write Speed: 490.07 MS / DTO
+ * Compression ratio: 0.1242
+ */
+ LZMA2(3);
+
+
+
+ /** More stable than using the ordinal of the enum */
+ public final byte value;
+
+ EDhApiDataCompressionMode(int value) { this.value = (byte) value; }
+
+
+ public static EDhApiDataCompressionMode getFromValue(byte value)
+ {
+ EDhApiDataCompressionMode[] enumList = EDhApiDataCompressionMode.values();
+ for (int i = 0; i < enumList.length; i++)
+ {
+ if (enumList[i].value == value)
+ {
+ return enumList[i];
+ }
+ }
+
+ throw new IllegalArgumentException("No compression mode with the value ["+value+"]");
+ }
+
+
+}
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EGLErrorHandlingMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGLErrorHandlingMode.java
similarity index 91%
rename from api/src/main/java/com/seibel/distanthorizons/api/enums/config/EGLErrorHandlingMode.java
rename to api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGLErrorHandlingMode.java
index 00719a140..5e5013613 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EGLErrorHandlingMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGLErrorHandlingMode.java
@@ -20,9 +20,10 @@
package com.seibel.distanthorizons.api.enums.config;
/**
- * @since API 1.0.0
+ * @since API 1.1.0
+ * @version 2024-4-6
*/
-public enum EGLErrorHandlingMode
+public enum EDhApiGLErrorHandlingMode
{
IGNORE,
LOG,
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EGlProfileMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGlProfileMode.java
similarity index 92%
rename from api/src/main/java/com/seibel/distanthorizons/api/enums/config/EGlProfileMode.java
rename to api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGlProfileMode.java
index b4247d66f..3e383e758 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EGlProfileMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGlProfileMode.java
@@ -20,9 +20,10 @@
package com.seibel.distanthorizons.api.enums.config;
/**
- * @since API 1.0.0
+ * @since API 1.1.0
+ * @version 2024-4-6
*/
-public enum EGlProfileMode
+public enum EDhApiGlProfileMode
{
CORE,
COMPAT,
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EGpuUploadMethod.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGpuUploadMethod.java
similarity index 92%
rename from api/src/main/java/com/seibel/distanthorizons/api/enums/config/EGpuUploadMethod.java
rename to api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGpuUploadMethod.java
index d87d8738d..8f3f5ec9c 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EGpuUploadMethod.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGpuUploadMethod.java
@@ -28,10 +28,10 @@ package com.seibel.distanthorizons.api.enums.config;
*
* @author Leetom
* @author James Seibel
- * @version 2022-7-2
- * @since API 1.0.0
+ * @version 2024-4-6
+ * @since API 1.1.0
*/
-public enum EGpuUploadMethod
+public enum EDhApiGpuUploadMethod
{
/** Picks the best option based on the GPU the user has. */
AUTO(false, false),
@@ -60,7 +60,7 @@ public enum EGpuUploadMethod
public final boolean useEarlyMapping;
public final boolean useBufferStorage;
- EGpuUploadMethod(boolean useEarlyMapping, boolean useBufferStorage)
+ EDhApiGpuUploadMethod(boolean useEarlyMapping, boolean useBufferStorage)
{
this.useEarlyMapping = useEarlyMapping;
this.useBufferStorage = useBufferStorage;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/ELightGenerationMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGrassSideRendering.java
similarity index 85%
rename from api/src/main/java/com/seibel/distanthorizons/api/enums/config/ELightGenerationMode.java
rename to api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGrassSideRendering.java
index cc57d08b7..2f2f1a8fa 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/ELightGenerationMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiGrassSideRendering.java
@@ -20,21 +20,21 @@
package com.seibel.distanthorizons.api.enums.config;
/**
- * DISTANT_HORIZONS,
- * MINECRAFT,
+ * AS_GRASS
+ * FADE_TO_DIRT
+ * AS_DIRT
*
- * @author Leetom
- * @version 2023-6-7
- * @since API 1.0.0
+ * @since API 1.1.0
+ * @version 2024-4-7
*/
-public enum ELightGenerationMode
+public enum EDhApiGrassSideRendering
{
// Reminder:
// when adding items up the API minor version
// when removing items up the API major version
- DISTANT_HORIZONS,
-
- MINECRAFT
+ AS_GRASS,
+ FADE_TO_DIRT,
+ AS_DIRT;
}
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EHorizontalQuality.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiHorizontalQuality.java
similarity index 88%
rename from api/src/main/java/com/seibel/distanthorizons/api/enums/config/EHorizontalQuality.java
rename to api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiHorizontalQuality.java
index 3fdcddd83..bdf7967cf 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EHorizontalQuality.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiHorizontalQuality.java
@@ -26,9 +26,10 @@ package com.seibel.distanthorizons.api.enums.config;
* HIGH
* UNLIMITED
*
- * @since API 1.0.0
+ * @since API 1.1.0
+ * @version 2024-4-6
*/
-public enum EHorizontalQuality
+public enum EDhApiHorizontalQuality
{
// Reminder:
// when adding items up the API minor version
@@ -42,17 +43,16 @@ public enum EHorizontalQuality
LOWEST(2.0f, 4),
LOW(2.0f, 8),
MEDIUM(2.0f, 12),
- HIGH(2.2f, 24),
- EXTREME(2.4f, 64),
-
- UNLIMITED(-1, -1);
+ HIGH(2.2f, 16),
+ EXTREME(2.4f, 32),
+ ;
public final double quadraticBase;
public final int distanceUnitInBlocks;
- EHorizontalQuality(double quadraticBase, int distanceUnitInBlocks)
+ EDhApiHorizontalQuality(double quadraticBase, int distanceUnitInBlocks)
{
this.quadraticBase = quadraticBase;
this.distanceUnitInBlocks = distanceUnitInBlocks;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/ELodShading.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiLodShading.java
similarity index 77%
rename from api/src/main/java/com/seibel/distanthorizons/api/enums/config/ELodShading.java
rename to api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiLodShading.java
index b098bbab0..b3ca135b8 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/ELodShading.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiLodShading.java
@@ -20,27 +20,33 @@
package com.seibel.distanthorizons.api.enums.config;
/**
- * MINECRAFT
- * OLD_LIGHTING
- * NONE
+ * AUTO
+ * ENABLED
+ * DISABLED
*
- * @since API 1.0.0
+ * @since API 1.1.0
+ * @version 2024-4-6
*/
-public enum ELodShading
+public enum EDhApiLodShading
{
// Reminder:
// when adding items up the API minor version
// when removing items up the API major version
- /** Uses Minecraft's shading for LODs */
- MINECRAFT,
/**
- * Simulates Minecraft's shading.
+ * Uses Minecraft's shading for LODs.
+ * This means if Minecraft's shading is disabled DH's shading will be as well.
+ */
+ AUTO,
+
+ /**
+ * Simulates Minecraft's shading.
* This is most useful for shaders that disable Minecraft's shading
* but still require shading on LODs.
*/
- OLD_LIGHTING,
+ ENABLED,
+
/** LODs will have no shading */
- NONE;
+ DISABLED;
}
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/ELoggerMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiLoggerMode.java
similarity index 92%
rename from api/src/main/java/com/seibel/distanthorizons/api/enums/config/ELoggerMode.java
rename to api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiLoggerMode.java
index 3a16c88ed..eb9043a2e 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/ELoggerMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiLoggerMode.java
@@ -22,9 +22,10 @@ package com.seibel.distanthorizons.api.enums.config;
import org.apache.logging.log4j.Level;
/**
- * @since API 1.0.0
+ * @since API 1.1.0
+ * @version 2024-4-6
*/
-public enum ELoggerMode
+public enum EDhApiLoggerMode
{
DISABLED(Level.OFF, Level.OFF),
LOG_ALL_TO_FILE(Level.ALL, Level.OFF),
@@ -40,11 +41,14 @@ public enum ELoggerMode
LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE(Level.INFO, Level.WARN),
LOG_ERROR_TO_CHAT_AND_INFO_TO_FILE(Level.INFO, Level.ERROR),
;
+
public final Level levelForFile;
public final Level levelForChat;
- ELoggerMode(Level levelForFile, Level levelForChat)
+
+ EDhApiLoggerMode(Level levelForFile, Level levelForChat)
{
this.levelForFile = levelForFile;
this.levelForChat = levelForChat;
}
+
}
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EMaxHorizontalResolution.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiMaxHorizontalResolution.java
similarity index 80%
rename from api/src/main/java/com/seibel/distanthorizons/api/enums/config/EMaxHorizontalResolution.java
rename to api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiMaxHorizontalResolution.java
index e9139c20b..922932c1b 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EMaxHorizontalResolution.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiMaxHorizontalResolution.java
@@ -33,10 +33,10 @@ import com.seibel.distanthorizons.coreapi.util.MathUtil;
*
* @author James Seibel
* @author Leonardo Amato
- * @version 2023-6-14
- * @since API 1.0.0
+ * @since API 1.1.0
+ * @version 2024-4-6
*/
-public enum EMaxHorizontalResolution
+public enum EDhApiMaxHorizontalResolution
{
/** render 256 LODs for each chunk */
BLOCK(16, 0),
@@ -84,12 +84,12 @@ public enum EMaxHorizontalResolution
* 2nd dimension: An array of all LodDetails that are less than or
* equal to that detailLevel
*/
- private static EMaxHorizontalResolution[][] lowerDetailArrays;
+ private static EDhApiMaxHorizontalResolution[][] lowerDetailArrays;
- EMaxHorizontalResolution(int newLengthCount, int newDetailLevel)
+ EDhApiMaxHorizontalResolution(int newLengthCount, int newDetailLevel)
{
this.detailLevel = (byte) newDetailLevel;
this.dataPointLengthCount = newLengthCount;
@@ -129,20 +129,20 @@ public enum EMaxHorizontalResolution
* Returns an array of all LodDetails that have a detail level
* that is less than or equal to the given LodDetail
*/
- public static EMaxHorizontalResolution[] getSelfAndLowerDetails(EMaxHorizontalResolution detail)
+ public static EDhApiMaxHorizontalResolution[] getSelfAndLowerDetails(EDhApiMaxHorizontalResolution detail)
{
if (lowerDetailArrays == null)
{
// run first time setup
- lowerDetailArrays = new EMaxHorizontalResolution[EMaxHorizontalResolution.values().length][];
+ lowerDetailArrays = new EDhApiMaxHorizontalResolution[EDhApiMaxHorizontalResolution.values().length][];
// go through each LodDetail
- for (EMaxHorizontalResolution currentDetail : EMaxHorizontalResolution.values())
+ for (EDhApiMaxHorizontalResolution currentDetail : EDhApiMaxHorizontalResolution.values())
{
- ArrayList lowerDetails = new ArrayList<>();
+ ArrayList lowerDetails = new ArrayList<>();
// find the details lower than currentDetail
- for (EMaxHorizontalResolution compareDetail : EMaxHorizontalResolution.values())
+ for (EDhApiMaxHorizontalResolution compareDetail : EDhApiMaxHorizontalResolution.values())
{
if (currentDetail.detailLevel <= compareDetail.detailLevel)
{
@@ -154,7 +154,7 @@ public enum EMaxHorizontalResolution
Collections.sort(lowerDetails);
Collections.reverse(lowerDetails);
- lowerDetailArrays[currentDetail.detailLevel] = lowerDetails.toArray(new EMaxHorizontalResolution[lowerDetails.size()]);
+ lowerDetailArrays[currentDetail.detailLevel] = lowerDetails.toArray(new EDhApiMaxHorizontalResolution[lowerDetails.size()]);
}
}
@@ -162,9 +162,9 @@ public enum EMaxHorizontalResolution
}
/** Returns what detail level should be used at a given distance and maxDistance. */
- public static EMaxHorizontalResolution getDetailForDistance(EMaxHorizontalResolution maxDetailLevel, int distance, int maxDistance)
+ public static EDhApiMaxHorizontalResolution getDetailForDistance(EDhApiMaxHorizontalResolution maxDetailLevel, int distance, int maxDistance)
{
- EMaxHorizontalResolution[] lowerDetails = getSelfAndLowerDetails(maxDetailLevel);
+ EDhApiMaxHorizontalResolution[] lowerDetails = getSelfAndLowerDetails(maxDetailLevel);
int distanceBetweenDetails = maxDistance / lowerDetails.length;
int index = MathUtil.clamp(0, distance / distanceBetweenDetails, lowerDetails.length - 1);
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EServerFolderNameMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiServerFolderNameMode.java
similarity index 92%
rename from api/src/main/java/com/seibel/distanthorizons/api/enums/config/EServerFolderNameMode.java
rename to api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiServerFolderNameMode.java
index 944e61457..69a8ea619 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EServerFolderNameMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiServerFolderNameMode.java
@@ -22,6 +22,7 @@ package com.seibel.distanthorizons.api.enums.config;
/**
* NAME_ONLY,
+ * IP_ONLY,
* NAME_IP,
* NAME_IP_PORT,
* NAME_IP_PORT_MC_VERSION,
@@ -29,10 +30,10 @@ package com.seibel.distanthorizons.api.enums.config;
* Determines how the multiplayer folders should be named.
*
* @author James Seibel
- * @version 2022-7-1
- * @since API 1.0.0
+ * @since API 1.1.0
+ * @version 2024-4-6
*/
-public enum EServerFolderNameMode
+public enum EDhApiServerFolderNameMode
{
// Reminder:
// when adding items up the API minor version
@@ -42,6 +43,9 @@ public enum EServerFolderNameMode
/** Only use the server name */
NAME_ONLY,
+ /** Only use the server IP */
+ IP_ONLY,
+
/**
* {SERVER_NAME} IP {IP}
* Example: Minecraft Server IP 192.168.1.40
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
new file mode 100644
index 000000000..e7eab618f
--- /dev/null
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiUpdateBranch.java
@@ -0,0 +1,14 @@
+package com.seibel.distanthorizons.api.enums.config;
+
+/**
+ * STABLE,
+ * NIGHTLY,
+ *
+ * @since API 1.1.0
+ * @version 2024-4-6
+ */
+public enum EDhApiUpdateBranch
+{
+ STABLE,
+ NIGHTLY
+}
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EVanillaOverdraw.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiVanillaOverdraw.java
similarity index 95%
rename from api/src/main/java/com/seibel/distanthorizons/api/enums/config/EVanillaOverdraw.java
rename to api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiVanillaOverdraw.java
index c9f9124ab..ed321d493 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EVanillaOverdraw.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiVanillaOverdraw.java
@@ -28,10 +28,11 @@ package com.seibel.distanthorizons.api.enums.config;
* the vanilla Minecraft terrain.
*
* @author James Seibel
- * @version 2022-6-30
+ * @since API 1.1.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
-public enum EVanillaOverdraw
+public enum EDhApiVanillaOverdraw
{
// Reminder:
// when adding items up the API minor version
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EVerticalQuality.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiVerticalQuality.java
similarity index 70%
rename from api/src/main/java/com/seibel/distanthorizons/api/enums/config/EVerticalQuality.java
rename to api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiVerticalQuality.java
index c20b86b70..0917ab82b 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EVerticalQuality.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiVerticalQuality.java
@@ -29,23 +29,25 @@ import com.seibel.distanthorizons.coreapi.util.MathUtil;
* EXTREME
*
* @author Leonardo Amato
- * @version 2023-2-5
- * @since API 1.0.0
+ * @version 2024-4-6
+ * @since API 1.1.0
*/
-public enum EVerticalQuality
+public enum EDhApiVerticalQuality
{
- HEIGHT_MAP(new int[]{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}),
- LOW(new int[]{4, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1}),
- MEDIUM(new int[]{6, 4, 3, 2, 2, 1, 1, 1, 1, 1, 1}),
- HIGH(new int[]{8, 6, 4, 2, 2, 2, 2, 1, 1, 1, 1}),
- EXTREME(new int[]{16, 8, 4, 2, 2, 2, 2, 1, 1, 1, 1});
+ HEIGHT_MAP( new int[]{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}),
+ LOW( new int[]{4, 3, 3, 2, 2, 1, 1, 1, 1, 1, 1}),
+ MEDIUM( new int[]{6, 4, 3, 3, 3, 3, 3, 2, 2, 2, 1}),
+ HIGH( new int[]{16, 8, 4, 3, 3, 3, 3, 3, 3, 3, 1}),
+ VERY_HIGH( new int[]{32, 16, 8, 4, 4, 3, 3, 3, 3, 3, 1}),
+ EXTREME( new int[]{64, 32, 8, 4, 4, 3, 3, 3, 3, 3, 1}),
+ PIXEL_ART( new int[]{512, 64, 16, 8, 4, 3, 3, 3, 3, 3, 1});
/** represents how many LODs can be rendered in a single vertical slice */
public final int[] maxVerticalData;
- EVerticalQuality(int[] maxVerticalData) { this.maxVerticalData = maxVerticalData; }
+ EDhApiVerticalQuality(int[] maxVerticalData) { this.maxVerticalData = maxVerticalData; }
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
new file mode 100644
index 000000000..d8abc9eb0
--- /dev/null
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EDhApiWorldCompressionMode.java
@@ -0,0 +1,70 @@
+/*
+ * This file is part of the Distant Horizons mod
+ * licensed under the GNU LGPL v3 License.
+ *
+ * Copyright (C) 2020-2023 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.distanthorizons.api.enums.config;
+
+/**
+ * MERGE_SAME_BLOCKS
+ * VISUALLY_EQUAL
+ *
+ * @version 2024-3-27
+ * @since API 1.1.0
+ */
+public enum EDhApiWorldCompressionMode
+{
+ // Reminder:
+ // when adding items up the API minor version
+ // when removing items up the API major version
+
+ /**
+ * Every block/biome change is recorded in the database.
+ * This is what DH 2.0 and 2.0.1 all used by default and will store a lot of data.
+ */
+ MERGE_SAME_BLOCKS(0),
+
+ /**
+ * Only visible block/biome changes are recorded in the database.
+ * Hidden blocks (IE ores) are ignored.
+ */
+ VISUALLY_EQUAL(1);
+
+
+
+ /** More stable than using the ordinal of the enum */
+ public final byte value;
+
+ EDhApiWorldCompressionMode(int value) { this.value = (byte) value; }
+
+
+ public static EDhApiWorldCompressionMode getFromValue(byte value)
+ {
+ EDhApiWorldCompressionMode[] enumList = EDhApiWorldCompressionMode.values();
+ for (int i = 0; i < enumList.length; i++)
+ {
+ if (enumList[i].value == value)
+ {
+ return enumList[i];
+ }
+ }
+
+ throw new IllegalArgumentException("No lossy compression mode with the value ["+value+"]");
+ }
+
+
+}
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EGenerationPriority.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EGenerationPriority.java
deleted file mode 100644
index 39271c3ee..000000000
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EGenerationPriority.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2023 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.distanthorizons.api.enums.config;
-
-/**
- * AUTO
- * Near_First
- * Far_First
- *
- * Determines which LODs should have priority when generating
- * outside the normal view distance.
- *
- * @author Leonardo Amato
- * @version 12-1-2021
- */
-@Deprecated // not currently in use, if the config this enum represents is re-implemented, the deprecated flag can be removed
-public enum EGenerationPriority
-{
- // Reminder:
- // when adding items up the API minor version
- // when removing items up the API major version
-
- /** NEAR_FIRST when connected to servers and BALANCED when on single player */
- AUTO,
-
- NEAR_FIRST,
-
- BALANCED,
-
- FAR_FIRST
-}
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EOverdrawPrevention.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EOverdrawPrevention.java
deleted file mode 100644
index 46f82868b..000000000
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EOverdrawPrevention.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2023 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.distanthorizons.api.enums.config;
-
-/**
- * NONE
- * LIGHT
- * MEDIUM
- * HEAVY
- *
- * CUSTOM
- *
- * @since API 1.0.0
- * @deprecated will be removed when DH updates to MC 1.21
- * After removal a float value will be used to control overdraw instead.
- */
-@Deprecated
-public enum EOverdrawPrevention
-{
- // Reminder:
- // when adding items up the API minor version
- // when removing items up the API major version
-
- NONE,
- LIGHT,
- MEDIUM,
- HEAVY,
-
- /**
- * Should not be passed in.
- * Is returned if the overdraw value doesn't match any of the enums defined here.
- */
- CUSTOM;
-}
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EUpdateBranch.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EUpdateBranch.java
deleted file mode 100644
index 09da806d5..000000000
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/EUpdateBranch.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.seibel.distanthorizons.api.enums.config;
-
-public enum EUpdateBranch
-{
- STABLE,
- NIGHTLY
-}
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EQualityPreset.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EDhApiQualityPreset.java
similarity index 94%
rename from api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EQualityPreset.java
rename to api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EDhApiQualityPreset.java
index 7936f3176..7bca56868 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EQualityPreset.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EDhApiQualityPreset.java
@@ -30,9 +30,10 @@ import com.seibel.distanthorizons.api.enums.config.DisallowSelectingViaConfigGui
* HIGH,
* EXTREME,
*
- * @since API 1.0.0
+ * @since API 1.1.0
+ * @version 2024-4-6
*/
-public enum EQualityPreset
+public enum EDhApiQualityPreset
{
// Reminder:
// when adding items up the API minor version
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EThreadPreset.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EDhApiThreadPreset.java
similarity index 92%
rename from api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EThreadPreset.java
rename to api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EDhApiThreadPreset.java
index 8773ff1a4..b10468e4f 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EThreadPreset.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/config/quickOptions/EDhApiThreadPreset.java
@@ -29,9 +29,10 @@ import com.seibel.distanthorizons.api.enums.config.DisallowSelectingViaConfigGui
* BALANCED,
* AGGRESSIVE,
*
- * @since API 1.0.0
+ * @since API 1.1.0
+ * @version 2024-4-6
*/
-public enum EThreadPreset
+public enum EDhApiThreadPreset
{
// Reminder:
// when adding items up the API minor version
@@ -44,8 +45,6 @@ public enum EThreadPreset
LOW_IMPACT,
BALANCED,
AGGRESSIVE,
-
- // temporarily removed due to stability concerns
I_PAID_FOR_THE_WHOLE_CPU,
}
\ No newline at end of file
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDebugRendering.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiDebugRendering.java
similarity index 86%
rename from api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDebugRendering.java
rename to api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiDebugRendering.java
index 62ee27786..646f9f25a 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDebugRendering.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiDebugRendering.java
@@ -28,10 +28,10 @@ package com.seibel.distanthorizons.api.enums.rendering;
*
* @author Leetom
* @author James Seibel
- * @version 2023-6-7
- * @since API 1.0.0
+ * @version 2024-4-6
+ * @since API 1.1.0
*/
-public enum EDebugRendering
+public enum EDhApiDebugRendering
{
// Reminder:
// when adding items up the API minor version
@@ -44,10 +44,6 @@ public enum EDebugRendering
/** LOD colors are based on their detail */
SHOW_DETAIL,
- @Deprecated
- /** LOD colors are based on their gen mode. */
- SHOW_GENMODE,
-
/** Block Materials are often used by Iris shaders to determine how LODs should be rendered */
SHOW_BLOCK_MATERIAL,
@@ -58,7 +54,7 @@ public enum EDebugRendering
SHOW_RENDER_SOURCE_FLAG;
- public static EDebugRendering next(EDebugRendering type)
+ public static EDhApiDebugRendering next(EDhApiDebugRendering type)
{
switch (type)
{
@@ -75,7 +71,7 @@ public enum EDebugRendering
}
}
- public static EDebugRendering previous(EDebugRendering type)
+ public static EDhApiDebugRendering previous(EDhApiDebugRendering type)
{
switch (type)
{
@@ -84,8 +80,6 @@ public enum EDebugRendering
case SHOW_RENDER_SOURCE_FLAG:
return SHOW_OVERLAPPING_QUADS;
case SHOW_OVERLAPPING_QUADS:
- return SHOW_GENMODE;
- case SHOW_GENMODE:
return SHOW_DETAIL;
default:
return OFF;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogColorMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiFogColorMode.java
similarity index 95%
rename from api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogColorMode.java
rename to api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiFogColorMode.java
index ab0831d49..8900574c5 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogColorMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiFogColorMode.java
@@ -24,10 +24,10 @@ package com.seibel.distanthorizons.api.enums.rendering;
* USE_SKY_COLOR,
*
* @author James Seibel
- * @version 2022-6-9
- * @since API 1.0.0
+ * @version 2024-4-6
+ * @since API 1.1.0
*/
-public enum EFogColorMode
+public enum EDhApiFogColorMode
{
// Reminder:
// when adding items: up the API minor version
@@ -44,4 +44,5 @@ public enum EFogColorMode
* https://www.curseforge.com/minecraft/mc-mods/clear-skies-forge-port
*/
USE_SKY_COLOR,
+
}
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogDrawMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiFogDrawMode.java
similarity index 96%
rename from api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogDrawMode.java
rename to api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiFogDrawMode.java
index 83c732142..1bc322109 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogDrawMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiFogDrawMode.java
@@ -25,10 +25,10 @@ package com.seibel.distanthorizons.api.enums.rendering;
* FOG_DISABLED
*
* @author James Seibel
+ * @since API 1.1.0
* @version 2022-6-2
- * @since API 1.0.0
*/
-public enum EFogDrawMode
+public enum EDhApiFogDrawMode
{
// Reminder:
// when adding items up the API minor version
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogFalloff.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiFogFalloff.java
similarity index 93%
rename from api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogFalloff.java
rename to api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiFogFalloff.java
index c1de07ece..4f310bf17 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogFalloff.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiFogFalloff.java
@@ -26,9 +26,9 @@ package com.seibel.distanthorizons.api.enums.rendering;
*
* @author Leetom
* @version 2022-6-30
- * @since API 1.0.0
+ * @since API 1.1.0
*/
-public enum EFogFalloff
+public enum EDhApiFogFalloff
{
// Reminder:
// when adding items up the API minor version
@@ -38,5 +38,5 @@ public enum EFogFalloff
LINEAR,
EXPONENTIAL,
EXPONENTIAL_SQUARED,
- // TEXTURE_BASED, // TODO: Impl this
+
}
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EHeightFogMixMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiHeightFogMixMode.java
similarity index 94%
rename from api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EHeightFogMixMode.java
rename to api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiHeightFogMixMode.java
index b688ebda8..13ab79dbb 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EHeightFogMixMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiHeightFogMixMode.java
@@ -32,10 +32,10 @@ package com.seibel.distanthorizons.api.enums.rendering;
* AVERAGE
*
* @author Leetom
- * @version 2022-4-14
- * @since API 1.0.0
+ * @version 2024-4-6
+ * @since API 1.1.0
*/
-public enum EHeightFogMixMode
+public enum EDhApiHeightFogMixMode
{
BASIC,
IGNORE_HEIGHT,
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EHeightFogMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiHeightFogMode.java
similarity index 91%
rename from api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EHeightFogMode.java
rename to api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiHeightFogMode.java
index 5aebcc8cd..99e538603 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EHeightFogMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiHeightFogMode.java
@@ -28,10 +28,10 @@ package com.seibel.distanthorizons.api.enums.rendering;
* ABOVE_AND_BELOW_SET_HEIGHT,
*
* @author Leetom
- * @version 6-30-2022
- * @since API 1.0.0
+ * @version 2024-4-6
+ * @since API 1.1.0
*/
-public enum EHeightFogMode
+public enum EDhApiHeightFogMode
{
// Reminder:
// when adding items up the API minor version
@@ -49,7 +49,7 @@ public enum EHeightFogMode
public final boolean above;
public final boolean below;
- EHeightFogMode(boolean basedOnCamera, boolean above, boolean below)
+ EDhApiHeightFogMode(boolean basedOnCamera, boolean above, boolean below)
{
this.basedOnCamera = basedOnCamera;
this.above = above;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/ERendererMode.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiRendererMode.java
similarity index 87%
rename from api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/ERendererMode.java
rename to api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiRendererMode.java
index a6a9c6c85..87a7099b1 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/ERendererMode.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiRendererMode.java
@@ -24,10 +24,10 @@ package com.seibel.distanthorizons.api.enums.rendering;
* Debug
* Disabled
*
- * @version 2022-6-2
- * @since API 1.0.0
+ * @since API 1.1.0
+ * @version 2024-4-6
*/
-public enum ERendererMode
+public enum EDhApiRendererMode
{
// Reminder:
// when adding items up the API minor version
@@ -40,7 +40,7 @@ public enum ERendererMode
/** Used by the config GUI to cycle through the available rendering options */
- public static ERendererMode next(ERendererMode type)
+ public static EDhApiRendererMode next(EDhApiRendererMode type)
{
switch (type)
{
@@ -54,7 +54,7 @@ public enum ERendererMode
}
/** Used by the config GUI to cycle through the available rendering options */
- public static ERendererMode previous(ERendererMode type)
+ public static EDhApiRendererMode previous(EDhApiRendererMode type)
{
switch (type)
{
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/ETransparency.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiTransparency.java
similarity index 89%
rename from api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/ETransparency.java
rename to api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiTransparency.java
index aefc14473..495c8fe6e 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/ETransparency.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EDhApiTransparency.java
@@ -24,9 +24,10 @@ package com.seibel.distanthorizons.api.enums.rendering;
* FAKE,
* COMPLETE,
*
- * @since API 1.0.0
+ * @since API 1.1.0
+ * @version 2024-4-6
*/
-public enum ETransparency
+public enum EDhApiTransparency
{
// Reminder:
// when adding items up the API minor version
@@ -40,7 +41,7 @@ public enum ETransparency
public final boolean transparencyEnabled;
public final boolean fakeTransparencyEnabled;
- ETransparency(boolean transparencyEnabled, boolean fakeTransparencyEnabled)
+ EDhApiTransparency(boolean transparencyEnabled, boolean fakeTransparencyEnabled)
{
this.transparencyEnabled = transparencyEnabled;
this.fakeTransparencyEnabled = fakeTransparencyEnabled;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogDistance.java b/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogDistance.java
deleted file mode 100644
index 5196ad696..000000000
--- a/api/src/main/java/com/seibel/distanthorizons/api/enums/rendering/EFogDistance.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * This file is part of the Distant Horizons mod
- * licensed under the GNU LGPL v3 License.
- *
- * Copyright (C) 2020-2023 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.distanthorizons.api.enums.rendering;
-
-/**
- * NEAR,
- * FAR,
- * NEAR_AND_FAR
- *
- * @author James Seibel
- * @version 2022-6-2
- * @since API 1.0.0
- */
-public enum EFogDistance
-{
- // Reminder:
- // when adding items up the API minor version
- // when removing items up the API major version
-
- NEAR,
- FAR,
- NEAR_AND_FAR
-}
\ No newline at end of file
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/both/IDhApiWorldGenerationConfig.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/both/IDhApiWorldGenerationConfig.java
index d52733634..9ea48a2ac 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/both/IDhApiWorldGenerationConfig.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/both/IDhApiWorldGenerationConfig.java
@@ -19,7 +19,6 @@
package com.seibel.distanthorizons.api.interfaces.config.both;
-import com.seibel.distanthorizons.api.enums.config.ELightGenerationMode;
import com.seibel.distanthorizons.api.enums.worldGeneration.EDhApiDistantGeneratorMode;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigValue;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigGroup;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiAmbientOcclusionConfig.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiAmbientOcclusionConfig.java
index d20bac76e..8be9af11a 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiAmbientOcclusionConfig.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiAmbientOcclusionConfig.java
@@ -19,9 +19,6 @@
package com.seibel.distanthorizons.api.interfaces.config.client;
-import com.seibel.distanthorizons.api.enums.rendering.EFogColorMode;
-import com.seibel.distanthorizons.api.enums.rendering.EFogDistance;
-import com.seibel.distanthorizons.api.enums.rendering.EFogDrawMode;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigGroup;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigValue;
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiDebuggingConfig.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiDebuggingConfig.java
index 18f2aea84..ad45b6d61 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiDebuggingConfig.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiDebuggingConfig.java
@@ -19,7 +19,7 @@
package com.seibel.distanthorizons.api.interfaces.config.client;
-import com.seibel.distanthorizons.api.enums.rendering.EDebugRendering;
+import com.seibel.distanthorizons.api.enums.rendering.EDhApiDebugRendering;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigValue;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigGroup;
@@ -33,7 +33,7 @@ import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigGroup;
public interface IDhApiDebuggingConfig extends IDhApiConfigGroup
{
/** Can be used to debug the standard fake chunk rendering. */
- IDhApiConfigValue debugRendering();
+ IDhApiConfigValue debugRendering();
/** If enabled debug keybindings can be used. */
IDhApiConfigValue debugKeybindings();
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiFarFogConfig.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiFarFogConfig.java
index 95f0d0a3d..e50e76cff 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiFarFogConfig.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiFarFogConfig.java
@@ -19,8 +19,7 @@
package com.seibel.distanthorizons.api.interfaces.config.client;
-import com.seibel.distanthorizons.api.enums.rendering.EFogFalloff;
-import com.seibel.distanthorizons.api.enums.rendering.*;
+import com.seibel.distanthorizons.api.enums.rendering.EDhApiFogFalloff;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigGroup;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigValue;
@@ -64,7 +63,7 @@ public interface IDhApiFarFogConfig extends IDhApiConfigGroup
IDhApiConfigValue farFogMaxThickness();
/** Defines how the fog changes in thickness. */
- IDhApiConfigValue farFogFalloff();
+ IDhApiConfigValue farFogFalloff();
/** Defines the fog density. */
IDhApiConfigValue farFogDensity();
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiFogConfig.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiFogConfig.java
index f7ad27c84..3303615b1 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiFogConfig.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiFogConfig.java
@@ -19,10 +19,8 @@
package com.seibel.distanthorizons.api.interfaces.config.client;
-import com.seibel.distanthorizons.api.enums.rendering.EFogColorMode;
-import com.seibel.distanthorizons.api.enums.rendering.EFogDistance;
-import com.seibel.distanthorizons.api.enums.rendering.EFogDrawMode;
-import com.seibel.distanthorizons.api.enums.rendering.*;
+import com.seibel.distanthorizons.api.enums.rendering.EDhApiFogColorMode;
+import com.seibel.distanthorizons.api.enums.rendering.EDhApiFogDrawMode;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigGroup;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigValue;
@@ -58,14 +56,11 @@ public interface IDhApiFogConfig extends IDhApiConfigGroup
// basic fog settings //
//====================//
- /** Defines at what distance fog is rendered on fake chunks. */
- IDhApiConfigValue distance();
-
/** Should be used to enable/disable fog rendering. */
- IDhApiConfigValue drawMode();
+ IDhApiConfigValue drawMode();
/** Can be used to enable support with mods that change vanilla MC's fog color. */
- IDhApiConfigValue color();
+ IDhApiConfigValue color();
/**
* If enabled attempts to disable vanilla MC's fog on real chunks.
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiGpuBuffersConfig.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiGpuBuffersConfig.java
index 56f6febc7..4b0433f7a 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiGpuBuffersConfig.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiGpuBuffersConfig.java
@@ -19,7 +19,7 @@
package com.seibel.distanthorizons.api.interfaces.config.client;
-import com.seibel.distanthorizons.api.enums.config.EGpuUploadMethod;
+import com.seibel.distanthorizons.api.enums.config.EDhApiGpuUploadMethod;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigGroup;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigValue;
@@ -34,7 +34,7 @@ public interface IDhApiGpuBuffersConfig extends IDhApiConfigGroup
{
/** Defines how geometry data is uploaded to the GPU. */
- IDhApiConfigValue gpuUploadMethod();
+ IDhApiConfigValue gpuUploadMethod();
/**
* Defines how long we should wait after uploading one
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 eae828efc..eaf51d691 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
@@ -20,9 +20,8 @@
package com.seibel.distanthorizons.api.interfaces.config.client;
import com.seibel.distanthorizons.api.enums.config.*;
-import com.seibel.distanthorizons.api.enums.config.*;
-import com.seibel.distanthorizons.api.enums.rendering.ERendererMode;
-import com.seibel.distanthorizons.api.enums.rendering.ETransparency;
+import com.seibel.distanthorizons.api.enums.rendering.EDhApiRendererMode;
+import com.seibel.distanthorizons.api.enums.rendering.EDhApiTransparency;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigValue;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigGroup;
@@ -68,7 +67,7 @@ public interface IDhApiGraphicsConfig extends IDhApiConfigGroup
*
* Changing this config also changes {@link IDhApiGraphicsConfig#renderingEnabled()}'s value.
*/
- IDhApiConfigValue renderingMode();
+ IDhApiConfigValue renderingMode();
@@ -77,18 +76,18 @@ public interface IDhApiGraphicsConfig extends IDhApiConfigGroup
//==================//
/** Defines how detailed fake chunks are in the horizontal direction */
- IDhApiConfigValue maxHorizontalResolution();
+ IDhApiConfigValue maxHorizontalResolution();
/** Defines how detailed fake chunks are in the vertical direction */
- IDhApiConfigValue verticalQuality();
+ IDhApiConfigValue verticalQuality();
/** Modifies the quadratic function fake chunks use for horizontal quality drop-off. */
- IDhApiConfigValue horizontalQuality();
+ IDhApiConfigValue horizontalQuality();
- IDhApiConfigValue transparency();
+ IDhApiConfigValue transparency();
/** Defines what blocks won't be rendered as LODs. */
- IDhApiConfigValue blocksToAvoid();
+ IDhApiConfigValue blocksToAvoid();
/**
* Defines if the color of avoided blocks will color the block below them.
@@ -112,17 +111,6 @@ public interface IDhApiGraphicsConfig extends IDhApiConfigGroup
// advanced graphic settings //
//===========================//
- /**
- * Sets the distance used by the near clip plane to reduce
- * overdraw.
- * 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.
- *
- * @deprecated Use {@link IDhApiGraphicsConfig#overdrawPreventionRadius()} instead.
- */
- @Deprecated
- IDhApiConfigValue overdrawPrevention();
-
/**
* Sets the radius used by the near clip shader to reduce
* overdraw.
@@ -172,7 +160,7 @@ public interface IDhApiGraphicsConfig extends IDhApiConfigGroup
*
* @since API 1.1.0
*/
- IDhApiConfigValue lodShading();
+ IDhApiConfigValue lodShading();
/**
* Sets whether LODs outside the view frustum culling will
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiHeightFogConfig.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiHeightFogConfig.java
index 4e1c98753..754cc01a9 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiHeightFogConfig.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiHeightFogConfig.java
@@ -19,9 +19,9 @@
package com.seibel.distanthorizons.api.interfaces.config.client;
-import com.seibel.distanthorizons.api.enums.rendering.EFogFalloff;
-import com.seibel.distanthorizons.api.enums.rendering.EHeightFogMixMode;
-import com.seibel.distanthorizons.api.enums.rendering.EHeightFogMode;
+import com.seibel.distanthorizons.api.enums.rendering.EDhApiFogFalloff;
+import com.seibel.distanthorizons.api.enums.rendering.EDhApiHeightFogMixMode;
+import com.seibel.distanthorizons.api.enums.rendering.EDhApiHeightFogMode;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigGroup;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigValue;
@@ -40,10 +40,10 @@ public interface IDhApiHeightFogConfig extends IDhApiConfigGroup
{
/** Defines how the height fog mixes. */
- IDhApiConfigValue heightFogMixMode();
+ IDhApiConfigValue heightFogMixMode();
/** Defines how the height fog is drawn relative to the camera or world. */
- IDhApiConfigValue heightFogMode();
+ IDhApiConfigValue heightFogMode();
/**
* Defines the height fog's base height if {@link IDhApiHeightFogConfig#heightFogMode()}
@@ -64,7 +64,7 @@ public interface IDhApiHeightFogConfig extends IDhApiConfigGroup
IDhApiConfigValue heightFogMaxThickness();
/** Defines how the height fog changes in thickness. */
- IDhApiConfigValue heightFogFalloff();
+ IDhApiConfigValue heightFogFalloff();
/** Defines the height fog's density. */
IDhApiConfigValue heightFogDensity();
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiMultiplayerConfig.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiMultiplayerConfig.java
index 39edf49a5..20397f392 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiMultiplayerConfig.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiMultiplayerConfig.java
@@ -20,7 +20,7 @@
package com.seibel.distanthorizons.api.interfaces.config.client;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigValue;
-import com.seibel.distanthorizons.api.enums.config.EServerFolderNameMode;
+import com.seibel.distanthorizons.api.enums.config.EDhApiServerFolderNameMode;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigGroup;
/**
@@ -37,7 +37,7 @@ public interface IDhApiMultiplayerConfig extends IDhApiConfigGroup
* Defines how multiplayer server folders are named.
* Note: Changing this while connected to a multiplayer world will cause undefined behavior!
*/
- IDhApiConfigValue folderSavingMode();
+ IDhApiConfigValue folderSavingMode();
/**
* Defines the necessary similarity (as a percent) that two potential levels
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiScreenResizeEvent.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiColorDepthTextureCreatedEvent.java
similarity index 83%
rename from api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiScreenResizeEvent.java
rename to api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiColorDepthTextureCreatedEvent.java
index 387981aad..c67cd547d 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiScreenResizeEvent.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiColorDepthTextureCreatedEvent.java
@@ -23,16 +23,16 @@ import com.seibel.distanthorizons.api.methods.events.interfaces.IDhApiEvent;
import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhApiEventParam;
/**
- * Called before Distant Horizons starts rendering a buffer.
- * This event cannot be cancelled, use {@link DhApiBeforeRenderEvent} if you want to cancel rendering.
+ * Called whenever Distant Horizons (re)creates
+ * the color and depth textures it renders to.
*
* @author James Seibel
- * @version 2023-1-23
+ * @version 2024-3-2
* @since API 1.1.0
*/
-public abstract class DhApiScreenResizeEvent implements IDhApiEvent
+public abstract class DhApiColorDepthTextureCreatedEvent implements IDhApiEvent
{
- /** Fired immediately before Distant Horizons renders any transparent buffers. */
+ /** Fired before Distant Horizons creates. */
public abstract void onResize(DhApiEventParam event);
diff --git a/api/src/main/java/com/seibel/distanthorizons/api/objects/data/DhApiTerrainDataPoint.java b/api/src/main/java/com/seibel/distanthorizons/api/objects/data/DhApiTerrainDataPoint.java
index d78ca58e2..0c70dfbfb 100644
--- a/api/src/main/java/com/seibel/distanthorizons/api/objects/data/DhApiTerrainDataPoint.java
+++ b/api/src/main/java/com/seibel/distanthorizons/api/objects/data/DhApiTerrainDataPoint.java
@@ -40,7 +40,8 @@ public class DhApiTerrainDataPoint
*/
public final byte detailLevel;
- public final int lightLevel;
+ public final int blockLightLevel;
+ public final int skyLightLevel;
public final int topYBlockPos;
public final int bottomYBlockPos;
@@ -49,11 +50,12 @@ public class DhApiTerrainDataPoint
- public DhApiTerrainDataPoint(byte detailLevel, int lightLevel, int topYBlockPos, int bottomYBlockPos, IDhApiBlockStateWrapper blockStateWrapper, IDhApiBiomeWrapper biomeWrapper)
+ public DhApiTerrainDataPoint(byte detailLevel, int blockLightLevel, int skyLightLevel, int topYBlockPos, int bottomYBlockPos, IDhApiBlockStateWrapper blockStateWrapper, IDhApiBiomeWrapper biomeWrapper)
{
this.detailLevel = detailLevel;
- this.lightLevel = lightLevel;
+ this.blockLightLevel = blockLightLevel;
+ this.skyLightLevel = skyLightLevel;
this.topYBlockPos = topYBlockPos;
this.bottomYBlockPos = bottomYBlockPos;
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 6665b77be..723187c4e 100644
--- a/api/src/main/java/com/seibel/distanthorizons/coreapi/ModInfo.java
+++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/ModInfo.java
@@ -34,7 +34,7 @@ public final class ModInfo
public static final String NAME = "DistantHorizons";
/** Human-readable version of NAME */
public static final String READABLE_NAME = "Distant Horizons";
- public static final String VERSION = "2.0.2-a-dev";
+ public static final String VERSION = "2.0.3-a-dev";
/** Returns true if the current build is an unstable developer build, false otherwise. */
public static boolean IS_DEV_BUILD = VERSION.toLowerCase().contains("dev");
diff --git a/api/src/main/java/com/seibel/distanthorizons/coreapi/util/converters/RenderModeEnabledConverter.java b/api/src/main/java/com/seibel/distanthorizons/coreapi/util/converters/RenderModeEnabledConverter.java
index 2bb47acfe..207d3c8b0 100644
--- a/api/src/main/java/com/seibel/distanthorizons/coreapi/util/converters/RenderModeEnabledConverter.java
+++ b/api/src/main/java/com/seibel/distanthorizons/coreapi/util/converters/RenderModeEnabledConverter.java
@@ -19,7 +19,7 @@
package com.seibel.distanthorizons.coreapi.util.converters;
-import com.seibel.distanthorizons.api.enums.rendering.ERendererMode;
+import com.seibel.distanthorizons.api.enums.rendering.EDhApiRendererMode;
import com.seibel.distanthorizons.coreapi.interfaces.config.IConverter;
/**
@@ -28,17 +28,17 @@ import com.seibel.distanthorizons.coreapi.interfaces.config.IConverter;
* @author James Seibel
* @version 2022-6-30
*/
-public class RenderModeEnabledConverter implements IConverter
+public class RenderModeEnabledConverter implements IConverter
{
- @Override public ERendererMode convertToCoreType(Boolean renderingEnabled)
+ @Override public EDhApiRendererMode convertToCoreType(Boolean renderingEnabled)
{
- return renderingEnabled ? ERendererMode.DEFAULT : ERendererMode.DISABLED;
+ return renderingEnabled ? EDhApiRendererMode.DEFAULT : EDhApiRendererMode.DISABLED;
}
- @Override public Boolean convertToApiType(ERendererMode renderingMode)
+ @Override public Boolean convertToApiType(EDhApiRendererMode renderingMode)
{
- return renderingMode == ERendererMode.DEFAULT;
+ return renderingMode == EDhApiRendererMode.DEFAULT;
}
}
diff --git a/core/src/test/java/tests/ExampleTest.java b/api/src/test/java/tests/ExampleApiTest.java
similarity index 97%
rename from core/src/test/java/tests/ExampleTest.java
rename to api/src/test/java/tests/ExampleApiTest.java
index 63e1ecf89..ebf7c52a1 100644
--- a/core/src/test/java/tests/ExampleTest.java
+++ b/api/src/test/java/tests/ExampleApiTest.java
@@ -28,7 +28,7 @@ import org.junit.Test;
* @author James Seibel
* @version 2022-9-5
*/
-public class ExampleTest
+public class ExampleApiTest
{
@Test
diff --git a/core/build.gradle b/core/build.gradle
new file mode 100644
index 000000000..172f997d8
--- /dev/null
+++ b/core/build.gradle
@@ -0,0 +1,122 @@
+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
+}
+
+apply plugin: "application"
+
+application {
+ mainClass.set("com.seibel.distanthorizons.core.jar.JarMain")
+}
+
+configurations {
+ shadowedArtifact // Used by DH to specify that we want to implement the shadowed core JAR file instead of the regular JAR file
+ shade
+ implementation.extendsFrom shade
+}
+
+OperatingSystem os = org.gradle.nativeplatform.platform.internal.DefaultNativePlatform.currentOperatingSystem;
+
+// Set the OS lwjgl is using to the current os
+project.ext.lwjglNatives = "natives-" + os.toFamilyName()
+
+dependencies { // All of these dependencies are in Vanilla Minecraft, but we need to depend on it as we arent importing Minecraft in the core
+ // Imports most of lwjgl's libraries (well, only the ones that we need)
+ implementation platform("org.lwjgl:lwjgl-bom:${rootProject.lwjgl_version}") // TODO: Use Minecraft's version for lwjgl_version (which changes in nearly every version) instead of a hard defined version for all versions
+
+ // REMEMBER: Dont shadow stuff here, these are just the libs that are included in Minecraft so that the core can use
+ implementation "org.lwjgl:lwjgl"
+ implementation "org.lwjgl:lwjgl-assimp"
+ implementation "org.lwjgl:lwjgl-glfw"
+ implementation "org.lwjgl:lwjgl-openal"
+ implementation "org.lwjgl:lwjgl-opengl"
+ implementation "org.lwjgl:lwjgl-stb"
+ implementation "org.lwjgl:lwjgl-tinyfd"
+ runtimeOnly "org.lwjgl:lwjgl::$lwjglNatives"
+ runtimeOnly "org.lwjgl:lwjgl-assimp::$lwjglNatives"
+ runtimeOnly "org.lwjgl:lwjgl-glfw::$lwjglNatives"
+ runtimeOnly "org.lwjgl:lwjgl-openal::$lwjglNatives"
+ runtimeOnly "org.lwjgl:lwjgl-opengl::$lwjglNatives"
+ runtimeOnly "org.lwjgl:lwjgl-stb::$lwjglNatives"
+ runtimeOnly "org.lwjgl:lwjgl-tinyfd::$lwjglNatives"
+
+
+ // fast util
+ shade("it.unimi.dsi:fastutil:${rootProject.fastutil_version}")
+
+ // Compression
+ shade("org.lz4:lz4-java:${rootProject.lz4_version}") // LZ4
+ shade("com.github.luben:zstd-jni:${rootProject.zstd_version}") // Zstd
+ shade("org.tukaani:xz:${rootProject.xz_version}") // LZMA
+
+ // Sqlite Database
+ shade("org.xerial:sqlite-jdbc:${rootProject.sqlite_jdbc_version}")
+
+ // Netty
+ shade("io.netty:netty-all:${rootProject.netty_version}")
+
+ // NightConfig (includes Toml & Json)
+ // needed in both common and core
+ shade("com.electronwill.night-config:toml:${rootProject.nightconfig_version}")
+ shade("com.electronwill.night-config:json:${rootProject.nightconfig_version}")
+
+
+ // needed for the standalone jar
+ shade("org.apache.logging.log4j:log4j-core:2.23.1")
+ shade("org.apache.logging.log4j:log4j-api:2.23.1")
+
+ // SVG (not needed atm)
+ //shade("com.formdev:svgSalamander:${rootProject.svgSalamander_version}")
+
+
+
+
+ // Some other dependencies
+ implementation("org.jetbrains:annotations:16.0.2")
+ implementation("com.google.code.findbugs:jsr305:3.0.2")
+ implementation("com.google.common:google-collect:0.5")
+ implementation("com.google.guava:guava:31.1-jre")
+
+}
+
+artifacts {
+ shade shadowJar
+ shadowedArtifact shadowJar // Setup the configuration shadowedArtifact to be the shadowJar
+}
+
+shadowJar {
+ configurations = [project.configurations.shade]
+
+ def librariesLocation = "distanthorizons.libraries"
+
+
+ relocate "it.unimi.dsi.fastutil", "${librariesLocation}.unimi.dsi.fastutil"
+
+ // LWJGL
+ // Only ever shadow the dependencies we use otherwise some stuff would break when running on an external client
+ relocate "org.lwjgl.system.jawt", "${librariesLocation}.lwjgl.system.jawt"
+
+ // Compression
+ relocate "net.jpountz", "${librariesLocation}.jpountz"
+ relocate "com.github.luben", "${librariesLocation}.github.luben"
+ relocate "org.tukaani", "${librariesLocation}.tukaani"
+
+ // Sqlite Database
+ //At the moment, there is a bug in this library which doesnt allow it to be relocated
+// relocate "org.sqlite", "${librariesLocation}.sqlite"
+
+ // JOML
+ if (project.hasProperty("embed_joml") && embed_joml == "true")
+ relocate "org.joml", "${librariesLocation}.joml"
+
+ // NightConfig (includes Toml & Json)
+ relocate "com.electronwill.nightconfig", "${librariesLocation}.electronwill.nightconfig"
+
+ // Netty
+ relocate "io.netty", "${librariesLocation}.netty"
+
+ relocate "org.apache.logging", "${librariesLocation}.apache.logging"
+
+
+ mergeServiceFiles()
+}
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/Initializer.java b/core/src/main/java/com/seibel/distanthorizons/core/Initializer.java
index e74d7bedd..b84c721ef 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/Initializer.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/Initializer.java
@@ -26,17 +26,14 @@ import com.seibel.distanthorizons.coreapi.ModInfo;
import com.seibel.distanthorizons.core.world.DhApiWorldProxy;
import com.seibel.distanthorizons.core.api.external.methods.config.DhApiConfig;
import com.seibel.distanthorizons.core.api.external.methods.data.DhApiTerrainDataRepo;
-import com.seibel.distanthorizons.core.dataObjects.fullData.loader.CompleteFullDataSourceLoader;
-import com.seibel.distanthorizons.core.dataObjects.fullData.loader.HighDetailIncompleteFullDataSourceLoader;
import com.seibel.distanthorizons.api.DhApi;
-import com.seibel.distanthorizons.core.dataObjects.fullData.loader.LowDetailIncompleteFullDataSourceLoader;
import com.seibel.distanthorizons.core.render.DhApiRenderProxy;
-//import io.netty.buffer.ByteBuf;
-import net.jpountz.lz4.LZ4Compressor;
+import io.netty.buffer.ByteBuf;
+import net.jpountz.lz4.LZ4FrameOutputStream;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
-import java.io.InputStream;
+import java.awt.*;
/** Handles first time Core setup. */
public class Initializer
@@ -50,11 +47,11 @@ public class Initializer
{
// if any library isn't present in the jar its class
// will throw an error (not an exception)
- Class> compressor = LZ4Compressor.class;
- //Class> networking = ByteBuf.class;
+ Class> compressor = LZ4FrameOutputStream.class;
+ Class> networking = ByteBuf.class;
Class> toml = com.electronwill.nightconfig.core.Config.class;
}
- catch (NoClassDefFoundError e)
+ catch (Throwable e)
{
LOGGER.fatal("Critical programmer error: One or more libraries aren't present. Error: [" + e.getMessage() + "].");
throw e;
@@ -76,10 +73,16 @@ public class Initializer
}
-
- CompleteFullDataSourceLoader unused2 = new CompleteFullDataSourceLoader(); // Auto register into the loader system
- HighDetailIncompleteFullDataSourceLoader unused3 = new HighDetailIncompleteFullDataSourceLoader(); // Auto register
- LowDetailIncompleteFullDataSourceLoader unused4 = new LowDetailIncompleteFullDataSourceLoader(); // Auto register
+ // attempt to setup Swing so we can display dialogs (popup windows)
+ System.setProperty("java.awt.headless", "false");
+ if (GraphicsEnvironment.isHeadless())
+ {
+ LOGGER.warn("Java.awt.headless is false. This means Distant Horizons can't display error and info dialog windows.");
+ }
+ else
+ {
+ LOGGER.info("Java.awt.headless set to true. Distant Horizons can correctly display error and info dialog windows.");
+ }
// link Core's config to the API
DhApi.Delayed.configs = DhApiConfig.INSTANCE;
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiDebuggingConfig.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiDebuggingConfig.java
index e34b964b9..925dfc3da 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiDebuggingConfig.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiDebuggingConfig.java
@@ -23,7 +23,7 @@ import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigValue;
import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiDebuggingConfig;
import com.seibel.distanthorizons.api.objects.config.DhApiConfigValue;
import com.seibel.distanthorizons.core.config.Config;
-import com.seibel.distanthorizons.api.enums.rendering.EDebugRendering;
+import com.seibel.distanthorizons.api.enums.rendering.EDhApiDebugRendering;
public class DhApiDebuggingConfig implements IDhApiDebuggingConfig
{
@@ -33,8 +33,8 @@ public class DhApiDebuggingConfig implements IDhApiDebuggingConfig
- public IDhApiConfigValue debugRendering()
- { return new DhApiConfigValue(Config.Client.Advanced.Debugging.debugRendering); }
+ public IDhApiConfigValue debugRendering()
+ { return new DhApiConfigValue(Config.Client.Advanced.Debugging.debugRendering); }
public IDhApiConfigValue debugKeybindings()
{ return new DhApiConfigValue(Config.Client.Advanced.Debugging.enableDebugKeybindings); }
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiFarFogConfig.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiFarFogConfig.java
index 1bacc727c..0393ccbdb 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiFarFogConfig.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiFarFogConfig.java
@@ -19,7 +19,7 @@
package com.seibel.distanthorizons.core.api.external.methods.config.client;
-import com.seibel.distanthorizons.api.enums.rendering.EFogFalloff;
+import com.seibel.distanthorizons.api.enums.rendering.EDhApiFogFalloff;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigValue;
import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiFarFogConfig;
import com.seibel.distanthorizons.api.objects.config.DhApiConfigValue;
@@ -50,8 +50,8 @@ public class DhApiFarFogConfig implements IDhApiFarFogConfig
{ return new DhApiConfigValue(Config.Client.Advanced.Graphics.Fog.AdvancedFog.farFogMax); }
@Override
- public IDhApiConfigValue farFogFalloff()
- { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Fog.AdvancedFog.farFogFalloff); }
+ public IDhApiConfigValue farFogFalloff()
+ { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Fog.AdvancedFog.farFogFalloff); }
@Override
public IDhApiConfigValue farFogDensity()
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiFogConfig.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiFogConfig.java
index 9889723f2..cc89c53de 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiFogConfig.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiFogConfig.java
@@ -19,9 +19,8 @@
package com.seibel.distanthorizons.core.api.external.methods.config.client;
-import com.seibel.distanthorizons.api.enums.rendering.EFogColorMode;
-import com.seibel.distanthorizons.api.enums.rendering.EFogDistance;
-import com.seibel.distanthorizons.api.enums.rendering.EFogDrawMode;
+import com.seibel.distanthorizons.api.enums.rendering.EDhApiFogColorMode;
+import com.seibel.distanthorizons.api.enums.rendering.EDhApiFogDrawMode;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigValue;
import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiFarFogConfig;
import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiFogConfig;
@@ -53,15 +52,11 @@ public class DhApiFogConfig implements IDhApiFogConfig
//====================//
@Override
- public IDhApiConfigValue distance()
- { return new DhApiConfigValue<>(Config.Client.Advanced.Graphics.Fog.distance); }
-
- @Override
- public IDhApiConfigValue drawMode()
+ public IDhApiConfigValue drawMode()
{ return new DhApiConfigValue<>(Config.Client.Advanced.Graphics.Fog.drawMode); }
@Override
- public IDhApiConfigValue color()
+ public IDhApiConfigValue color()
{ return new DhApiConfigValue<>(Config.Client.Advanced.Graphics.Fog.colorMode); }
@Override
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiGpuBuffersConfig.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiGpuBuffersConfig.java
index 7069e5df4..22f4852b0 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiGpuBuffersConfig.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiGpuBuffersConfig.java
@@ -23,7 +23,7 @@ import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigValue;
import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiGpuBuffersConfig;
import com.seibel.distanthorizons.api.objects.config.DhApiConfigValue;
import com.seibel.distanthorizons.core.config.Config;
-import com.seibel.distanthorizons.api.enums.config.EGpuUploadMethod;
+import com.seibel.distanthorizons.api.enums.config.EDhApiGpuUploadMethod;
public class DhApiGpuBuffersConfig implements IDhApiGpuBuffersConfig
{
@@ -33,7 +33,7 @@ public class DhApiGpuBuffersConfig implements IDhApiGpuBuffersConfig
- public IDhApiConfigValue gpuUploadMethod()
+ public IDhApiConfigValue gpuUploadMethod()
{ return new DhApiConfigValue<>(Config.Client.Advanced.GpuBuffers.gpuUploadMethod); }
public IDhApiConfigValue gpuUploadPerMegabyteInMilliseconds()
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiGraphicsConfig.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiGraphicsConfig.java
index 63b810521..27c1d48eb 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiGraphicsConfig.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiGraphicsConfig.java
@@ -20,14 +20,14 @@
package com.seibel.distanthorizons.core.api.external.methods.config.client;
import com.seibel.distanthorizons.api.enums.config.*;
-import com.seibel.distanthorizons.api.enums.rendering.ETransparency;
+import com.seibel.distanthorizons.api.enums.rendering.EDhApiTransparency;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigValue;
import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiAmbientOcclusionConfig;
import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiFogConfig;
import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiGraphicsConfig;
import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiNoiseTextureConfig;
import com.seibel.distanthorizons.api.objects.config.DhApiConfigValue;
-import com.seibel.distanthorizons.api.enums.rendering.ERendererMode;
+import com.seibel.distanthorizons.api.enums.rendering.EDhApiRendererMode;
import com.seibel.distanthorizons.core.config.Config;
public class DhApiGraphicsConfig implements IDhApiGraphicsConfig
@@ -61,8 +61,8 @@ public class DhApiGraphicsConfig implements IDhApiGraphicsConfig
{ return new DhApiConfigValue(Config.Client.quickEnableRendering); }
@Override
- public IDhApiConfigValue renderingMode()
- { return new DhApiConfigValue(Config.Client.Advanced.Debugging.rendererMode); }
+ public IDhApiConfigValue renderingMode()
+ { return new DhApiConfigValue(Config.Client.Advanced.Debugging.rendererMode); }
@@ -71,24 +71,24 @@ public class DhApiGraphicsConfig implements IDhApiGraphicsConfig
//==================//
@Override
- public IDhApiConfigValue maxHorizontalResolution()
- { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.maxHorizontalResolution); }
+ public IDhApiConfigValue maxHorizontalResolution()
+ { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.maxHorizontalResolution); }
@Override
- public IDhApiConfigValue verticalQuality()
- { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.verticalQuality); }
+ public IDhApiConfigValue verticalQuality()
+ { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.verticalQuality); }
@Override
- public IDhApiConfigValue horizontalQuality()
- { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.horizontalQuality); }
+ public IDhApiConfigValue horizontalQuality()
+ { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.horizontalQuality); }
@Override
- public IDhApiConfigValue transparency()
- { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.transparency); }
+ public IDhApiConfigValue transparency()
+ { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.transparency); }
@Override
- public IDhApiConfigValue blocksToAvoid()
- { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.blocksToIgnore); }
+ public IDhApiConfigValue blocksToAvoid()
+ { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Quality.blocksToIgnore); }
@Override
public IDhApiConfigValue tintWithAvoidedBlocks()
@@ -105,11 +105,6 @@ public class DhApiGraphicsConfig implements IDhApiGraphicsConfig
// advanced graphic settings //
//===========================//
- @Deprecated
- @Override
- public IDhApiConfigValue overdrawPrevention()
- { return new DhApiConfigValue(Config.Client.Advanced.Graphics.AdvancedGraphics.overdrawPreventionPreset); }
-
@Override
public IDhApiConfigValue overdrawPreventionRadius()
{ return new DhApiConfigValue(Config.Client.Advanced.Graphics.AdvancedGraphics.overdrawPrevention); }
@@ -143,8 +138,8 @@ public class DhApiGraphicsConfig implements IDhApiGraphicsConfig
{ return new DhApiConfigValue(Config.Client.Advanced.Graphics.AdvancedGraphics.lodBias); }
@Override
- public IDhApiConfigValue lodShading()
- { return new DhApiConfigValue(Config.Client.Advanced.Graphics.AdvancedGraphics.lodShading); }
+ public IDhApiConfigValue lodShading()
+ { return new DhApiConfigValue(Config.Client.Advanced.Graphics.AdvancedGraphics.lodShading); }
@Override
public IDhApiConfigValue disableFrustumCulling()
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiHeightFogConfig.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiHeightFogConfig.java
index 866137bc0..ecd1090a2 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiHeightFogConfig.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiHeightFogConfig.java
@@ -19,9 +19,9 @@
package com.seibel.distanthorizons.core.api.external.methods.config.client;
-import com.seibel.distanthorizons.api.enums.rendering.EFogFalloff;
-import com.seibel.distanthorizons.api.enums.rendering.EHeightFogMixMode;
-import com.seibel.distanthorizons.api.enums.rendering.EHeightFogMode;
+import com.seibel.distanthorizons.api.enums.rendering.EDhApiFogFalloff;
+import com.seibel.distanthorizons.api.enums.rendering.EDhApiHeightFogMixMode;
+import com.seibel.distanthorizons.api.enums.rendering.EDhApiHeightFogMode;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigValue;
import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiHeightFogConfig;
import com.seibel.distanthorizons.api.objects.config.DhApiConfigValue;
@@ -36,12 +36,12 @@ public class DhApiHeightFogConfig implements IDhApiHeightFogConfig
@Override
- public IDhApiConfigValue heightFogMixMode()
- { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Fog.AdvancedFog.HeightFog.heightFogMixMode); }
+ public IDhApiConfigValue heightFogMixMode()
+ { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Fog.AdvancedFog.HeightFog.heightFogMixMode); }
@Override
- public IDhApiConfigValue heightFogMode()
- { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Fog.AdvancedFog.HeightFog.heightFogMode); }
+ public IDhApiConfigValue heightFogMode()
+ { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Fog.AdvancedFog.HeightFog.heightFogMode); }
@Override
public IDhApiConfigValue heightFogBaseHeight()
@@ -64,8 +64,8 @@ public class DhApiHeightFogConfig implements IDhApiHeightFogConfig
{ return new DhApiConfigValue(Config.Client.Advanced.Graphics.Fog.AdvancedFog.HeightFog.heightFogMax); }
@Override
- public IDhApiConfigValue heightFogFalloff()
- { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Fog.AdvancedFog.HeightFog.heightFogFalloff); }
+ public IDhApiConfigValue heightFogFalloff()
+ { return new DhApiConfigValue(Config.Client.Advanced.Graphics.Fog.AdvancedFog.HeightFog.heightFogFalloff); }
@Override
public IDhApiConfigValue heightFogDensity()
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiMultiplayerConfig.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiMultiplayerConfig.java
index e09d70244..1c16671d0 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiMultiplayerConfig.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiMultiplayerConfig.java
@@ -23,7 +23,7 @@ import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigValue;
import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiMultiplayerConfig;
import com.seibel.distanthorizons.api.objects.config.DhApiConfigValue;
import com.seibel.distanthorizons.core.config.Config;
-import com.seibel.distanthorizons.api.enums.config.EServerFolderNameMode;
+import com.seibel.distanthorizons.api.enums.config.EDhApiServerFolderNameMode;
public class DhApiMultiplayerConfig implements IDhApiMultiplayerConfig
{
@@ -33,8 +33,8 @@ public class DhApiMultiplayerConfig implements IDhApiMultiplayerConfig
- public IDhApiConfigValue folderSavingMode()
- { return new DhApiConfigValue(Config.Client.Advanced.Multiplayer.serverFolderNameMode); }
+ public IDhApiConfigValue folderSavingMode()
+ { return new DhApiConfigValue(Config.Client.Advanced.Multiplayer.serverFolderNameMode); }
public IDhApiConfigValue multiverseSimilarityRequirement()
{ return new DhApiConfigValue(Config.Client.Advanced.Multiplayer.multiverseSimilarityRequiredPercent); }
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/common/DhApiWorldGenerationConfig.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/common/DhApiWorldGenerationConfig.java
index 121909395..547f395b1 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/common/DhApiWorldGenerationConfig.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/common/DhApiWorldGenerationConfig.java
@@ -19,7 +19,6 @@
package com.seibel.distanthorizons.core.api.external.methods.config.common;
-import com.seibel.distanthorizons.api.enums.config.ELightGenerationMode;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigValue;
import com.seibel.distanthorizons.api.interfaces.config.both.IDhApiWorldGenerationConfig;
import com.seibel.distanthorizons.api.objects.config.DhApiConfigValue;
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 e2d2c8d66..e3f4f5210 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
@@ -27,8 +27,7 @@ import com.seibel.distanthorizons.api.interfaces.data.IDhApiTerrainDataRepo;
import com.seibel.distanthorizons.api.objects.math.DhApiVec3i;
import com.seibel.distanthorizons.core.api.internal.SharedApi;
import com.seibel.distanthorizons.core.dataObjects.fullData.FullDataPointIdMap;
-import com.seibel.distanthorizons.core.dataObjects.fullData.accessor.SingleColumnFullDataAccessor;
-import com.seibel.distanthorizons.core.dataObjects.fullData.sources.interfaces.IFullDataSource;
+import com.seibel.distanthorizons.core.dataObjects.fullData.sources.FullDataSourceV2;
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
import com.seibel.distanthorizons.core.level.IDhLevel;
import com.seibel.distanthorizons.core.pos.DhLodPos;
@@ -47,6 +46,7 @@ import com.seibel.distanthorizons.coreapi.util.BitShiftUtil;
import com.seibel.distanthorizons.coreapi.util.math.Vec3d;
import com.seibel.distanthorizons.coreapi.util.math.Vec3f;
import com.seibel.distanthorizons.coreapi.util.math.Vec3i;
+import it.unimi.dsi.fastutil.longs.LongArrayList;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -212,7 +212,7 @@ public class DhApiTerrainDataRepo implements IDhApiTerrainDataRepo
try
{
// attempt to get/generate the data source for this section
- IFullDataSource dataSource = level.getFileHandler().getAsync(sectionPos).get();
+ 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 + "].");
@@ -220,11 +220,11 @@ public class DhApiTerrainDataRepo implements IDhApiTerrainDataRepo
else
{
// attempt to get the LOD data from the data source
- FullDataPointIdMap mapping = dataSource.getMapping();
- SingleColumnFullDataAccessor dataColumn = dataSource.tryGet(relativePos.x, relativePos.z);
+ FullDataPointIdMap mapping = dataSource.mapping;
+ LongArrayList dataColumn = dataSource.get(relativePos.x, relativePos.z);
if (dataColumn != null)
{
- int dataColumnIndexCount = dataColumn.getSingleLength();
+ int dataColumnIndexCount = dataColumn.size();
DhApiTerrainDataPoint[] returnArray = new DhApiTerrainDataPoint[dataColumnIndexCount];
long dataPoint;
@@ -235,7 +235,7 @@ public class DhApiTerrainDataRepo implements IDhApiTerrainDataRepo
// search for a datapoint that contains the block y position
for (int i = 0; i < dataColumnIndexCount; i++)
{
- dataPoint = dataColumn.getSingle(i);
+ dataPoint = dataColumn.getLong(i);
if (!getSpecificYCoordinate)
{
@@ -290,7 +290,8 @@ public class DhApiTerrainDataRepo implements IDhApiTerrainDataRepo
int topY = bottomY + height;
return new DhApiTerrainDataPoint(detailLevel,
- FullDataPointUtil.getLight(dataPoint), topY, bottomY,
+ FullDataPointUtil.getBlockLight(dataPoint), FullDataPointUtil.getSkyLight(dataPoint),
+ topY, bottomY,
blockState, biomeWrapper);
}
@@ -460,7 +461,7 @@ public class DhApiTerrainDataRepo implements IDhApiTerrainDataRepo
// this will throw a cast exception if the chunk object array isn't correct
IChunkWrapper chunk = SingletonInjector.INSTANCE.get(IWrapperFactory.class).createChunkWrapper(chunkObjectArray);
- dhLevel.updateChunkAsync(chunk);
+ SharedApi.INSTANCE.applyChunkUpdate(chunk, dhLevel.getLevelWrapper(), true);
return DhApiResult.createSuccess();
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 4a81bd1c1..c29fcfeef 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
@@ -21,7 +21,6 @@ package com.seibel.distanthorizons.core.api.internal;
import com.seibel.distanthorizons.api.DhApi;
import com.seibel.distanthorizons.api.enums.rendering.EDhApiRenderPass;
-import com.seibel.distanthorizons.api.interfaces.override.rendering.IDhApiFramebuffer;
import com.seibel.distanthorizons.api.methods.events.abstractEvents.*;
import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhApiRenderParam;
import com.seibel.distanthorizons.core.level.IKeyedClientLevelManager;
@@ -32,10 +31,9 @@ import com.seibel.distanthorizons.core.world.*;
import com.seibel.distanthorizons.coreapi.DependencyInjection.ApiEventInjector;
import com.seibel.distanthorizons.core.level.IDhClientLevel;
import com.seibel.distanthorizons.core.config.Config;
-import com.seibel.distanthorizons.coreapi.DependencyInjection.OverrideInjector;
import com.seibel.distanthorizons.coreapi.ModInfo;
-import com.seibel.distanthorizons.api.enums.rendering.EDebugRendering;
-import com.seibel.distanthorizons.api.enums.rendering.ERendererMode;
+import com.seibel.distanthorizons.api.enums.rendering.EDhApiDebugRendering;
+import com.seibel.distanthorizons.api.enums.rendering.EDhApiRendererMode;
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
import com.seibel.distanthorizons.core.logging.ConfigBasedLogger;
import com.seibel.distanthorizons.core.logging.ConfigBasedSpamLogger;
@@ -54,7 +52,6 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.Nullable;
import org.lwjgl.glfw.GLFW;
-import org.lwjgl.opengl.GL32;
import java.util.HashMap;
import java.util.HashSet;
@@ -81,6 +78,10 @@ public class ClientApi
public static final long SPAM_LOGGER_FLUSH_NS = TimeUnit.NANOSECONDS.convert(1, TimeUnit.SECONDS);
private boolean configOverrideReminderPrinted = false;
+
+ private boolean migrationMessageShown = false;
+ private boolean showMigrationMessageNextFrame = false;
+
public boolean rendererDisabledBecauseOfExceptions = false;
private long lastFlushNanoTime = 0;
@@ -179,7 +180,7 @@ public class ClientApi
// can happen on certain multiverse servers
return;
}
- LOGGER.info("Unloading client level [" + level + "].");
+ LOGGER.info("Unloading client level [" + level + "]-["+level.getDimensionType().getDimensionName()+"].");
AbstractDhWorld world = SharedApi.getAbstractDhWorld();
if (world != null)
@@ -218,7 +219,7 @@ public class ClientApi
- LOGGER.info("Loading " + (isServerCommunication ? "Multiverse" : "") + " client level [" + level + "].");
+ LOGGER.info("Loading " + (isServerCommunication ? "Multiverse" : "") + " client level [" + level + "]-["+level.getDimensionType().getDimensionName()+"].");
AbstractDhWorld world = SharedApi.getAbstractDhWorld();
if (world != null)
@@ -473,14 +474,29 @@ public class ClientApi
{
// logging //
+ // dev build
if (ModInfo.IS_DEV_BUILD && !this.configOverrideReminderPrinted && MC.playerExists())
{
this.configOverrideReminderPrinted = true;
// remind the user that this is a development build
- MC.sendChatMessage(ModInfo.READABLE_NAME + " experimental build " + ModInfo.VERSION);
+ MC.sendChatMessage("Distant Horizons nightly experimental build version [" + ModInfo.VERSION+"].");
MC.sendChatMessage("You are running an unsupported version of Distant Horizons!");
MC.sendChatMessage("Here be dragons!");
+ MC.sendChatMessage("");
+ }
+
+ // data migration
+ if (this.showMigrationMessageNextFrame
+ && !this.migrationMessageShown
+ && Config.Client.Advanced.LodBuilding.showMigrationChatWarning.get())
+ {
+ this.showMigrationMessageNextFrame = false;
+ this.migrationMessageShown = true;
+
+ MC.sendChatMessage("Old Distant Horizons data is being migrated.");
+ MC.sendChatMessage("During migration LODs may load slowly and DH world gen is disabled.");
+ MC.sendChatMessage("");
}
IProfilerWrapper profiler = MC.getProfiler();
@@ -547,7 +563,7 @@ public class ClientApi
if (!renderingDeferredLayer)
{
- if (Config.Client.Advanced.Debugging.rendererMode.get() == ERendererMode.DEFAULT)
+ if (Config.Client.Advanced.Debugging.rendererMode.get() == EDhApiRendererMode.DEFAULT)
{
this.renderingCancelledForThisFrame = ApiEventInjector.INSTANCE.fireAllEvents(DhApiBeforeRenderEvent.class, renderEventParam);
if (!this.renderingCancelledForThisFrame)
@@ -560,7 +576,7 @@ public class ClientApi
ApiEventInjector.INSTANCE.fireAllEvents(DhApiAfterRenderEvent.class, renderEventParam);
}
}
- else if (Config.Client.Advanced.Debugging.rendererMode.get() == ERendererMode.DEBUG)
+ else if (Config.Client.Advanced.Debugging.rendererMode.get() == EDhApiRendererMode.DEBUG)
{
profiler.push("Render Debug");
ClientApi.testRenderer.render();
@@ -617,12 +633,12 @@ public class ClientApi
if (glfwKey == GLFW.GLFW_KEY_F8)
{
- Config.Client.Advanced.Debugging.debugRendering.set(EDebugRendering.next(Config.Client.Advanced.Debugging.debugRendering.get()));
+ Config.Client.Advanced.Debugging.debugRendering.set(EDhApiDebugRendering.next(Config.Client.Advanced.Debugging.debugRendering.get()));
MC.sendChatMessage("F8: Set debug mode to " + Config.Client.Advanced.Debugging.debugRendering.get());
}
else if (glfwKey == GLFW.GLFW_KEY_F6)
{
- Config.Client.Advanced.Debugging.rendererMode.set(ERendererMode.next(Config.Client.Advanced.Debugging.rendererMode.get()));
+ Config.Client.Advanced.Debugging.rendererMode.set(EDhApiRendererMode.next(Config.Client.Advanced.Debugging.rendererMode.get()));
MC.sendChatMessage("F6: Set rendering to " + Config.Client.Advanced.Debugging.rendererMode.get());
}
else if (glfwKey == GLFW.GLFW_KEY_P)
@@ -632,5 +648,7 @@ public class ClientApi
}
}
+ // TODO there's probably a better way of handling chat messages
+ public void showMigrationMessageOnNextFrame() { this.showMigrationMessageNextFrame = true; }
}
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/internal/ServerApi.java b/core/src/main/java/com/seibel/distanthorizons/core/api/internal/ServerApi.java
index d85dd8639..0d1e97862 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/internal/ServerApi.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/internal/ServerApi.java
@@ -38,11 +38,6 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper;
import com.seibel.distanthorizons.core.wrapperInterfaces.world.IServerLevelWrapper;
import org.apache.logging.log4j.Logger;
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.concurrent.ThreadPoolExecutor;
-
/**
* This holds the methods that should be called by the host mod loader (Fabric,
* Forge, etc.). Specifically server events.
diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/internal/SharedApi.java b/core/src/main/java/com/seibel/distanthorizons/core/api/internal/SharedApi.java
index b0499375d..c8ffe6de8 100644
--- a/core/src/main/java/com/seibel/distanthorizons/core/api/internal/SharedApi.java
+++ b/core/src/main/java/com/seibel/distanthorizons/core/api/internal/SharedApi.java
@@ -32,7 +32,7 @@ import com.seibel.distanthorizons.core.render.renderer.DebugRenderer;
import com.seibel.distanthorizons.core.util.LodUtil;
import com.seibel.distanthorizons.core.util.TimerUtil;
import com.seibel.distanthorizons.core.util.objects.Pair;
-import com.seibel.distanthorizons.core.util.threading.ThreadPools;
+import com.seibel.distanthorizons.core.util.threading.ThreadPoolUtil;
import com.seibel.distanthorizons.core.world.*;
import com.seibel.distanthorizons.core.wrapperInterfaces.chunk.IChunkWrapper;
import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftRenderWrapper;
@@ -46,6 +46,7 @@ import java.util.Set;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.ThreadPoolExecutor;
/** Contains code and variables used by both {@link ClientApi} and {@link ServerApi} */
@@ -102,11 +103,11 @@ public class SharedApi
// access the MC level at inappropriate times, which can cause exceptions
if (currentWorld != null)
{
- ThreadPools.setupThreadPools();
+ ThreadPoolUtil.setupThreadPools();
}
else
{
- ThreadPools.shutdownThreadPools();
+ ThreadPoolUtil.shutdownThreadPools();
DebugRenderer.clearRenderables();
MC_RENDER.clearTargetFrameBuffer();
@@ -285,77 +286,81 @@ public class SharedApi
private static void bakeChunkLightingAndSendToLevelAsync(IChunkWrapper chunkWrapper, @Nullable ArrayList neighbourChunkList, IDhLevel dhLevel)
{
// lighting the chunk needs to be done on a separate thread to prevent lagging any of the event threads
- ThreadPoolExecutor executor = ThreadPools.getLightPopulatorExecutor();
+ ThreadPoolExecutor executor = ThreadPoolUtil.getLightPopulatorExecutor();
if (executor == null)
{
return;
}
- executor.execute(() ->
+ try
{
- LOGGER.trace(chunkWrapper.getChunkPos() + " " + executor.getActiveCount() + " / " + executor.getQueue().size() + " - " + executor.getCompletedTaskCount());
-
- try
+ executor.execute(() ->
{
- // Save or populate the chunk wrapper's lighting
- // this is done so we don't have to worry about MC unloading the lighting data for this chunk
- boolean onlyUseDhLighting = Config.Client.Advanced.LodBuilding.onlyUseDhLightingEngine.get();
- if (!onlyUseDhLighting && chunkWrapper.isLightCorrect())
+ //LOGGER.trace(chunkWrapper.getChunkPos() + " " + executor.getActiveCount() + " / " + executor.getQueue().size() + " - " + executor.getCompletedTaskCount());
+
+ try
{
- try
+ // Save or populate the chunk wrapper's lighting
+ // this is done so we don't have to worry about MC unloading the lighting data for this chunk
+ boolean onlyUseDhLighting = Config.Client.Advanced.LodBuilding.onlyUseDhLightingEngine.get();
+ if (!onlyUseDhLighting && chunkWrapper.isLightCorrect())
{
- // If MC's lighting engine isn't thread safe this may cause the server thread to lag
- chunkWrapper.bakeDhLightingUsingMcLightingEngine();
- }
- catch (IllegalStateException e)
- {
- LOGGER.warn("Chunk light baking error: " + e.getMessage(), e);
- }
- }
- else
- {
- // generate the chunk's lighting, using neighboring chunks if present
-
- ArrayList nearbyChunkList;
- if (neighbourChunkList != null)
- {
- nearbyChunkList = neighbourChunkList;
+ try
+ {
+ // If MC's lighting engine isn't thread safe this may cause the server thread to lag
+ chunkWrapper.bakeDhLightingUsingMcLightingEngine();
+ }
+ catch (IllegalStateException e)
+ {
+ LOGGER.warn("Chunk light baking error: " + e.getMessage(), e);
+ }
}
else
{
- nearbyChunkList = new ArrayList<>(1);
- nearbyChunkList.add(chunkWrapper);
+ // generate the chunk's lighting, using neighboring chunks if present
+
+ ArrayList nearbyChunkList;
+ if (neighbourChunkList != null)
+ {
+ nearbyChunkList = neighbourChunkList;
+ }
+ else
+ {
+ nearbyChunkList = new ArrayList<>(1);
+ nearbyChunkList.add(chunkWrapper);
+ }
+
+ DhLightingEngine.INSTANCE.lightChunk(chunkWrapper, nearbyChunkList, dhLevel.hasSkyLight() ? 15 : 0);
}
- DhLightingEngine.INSTANCE.lightChunk(chunkWrapper, nearbyChunkList, dhLevel.hasSkyLight() ? 15 : 0);
+ dhLevel.updateChunkAsync(chunkWrapper);
}
-
- dhLevel.updateChunkAsync(chunkWrapper);
- }
- catch (Exception e)
- {
- LOGGER.error("Unexpected error when updating chunk at pos: ["+chunkWrapper.getChunkPos()+"]", e);
- }
- finally
- {
- // the LOD chunk has finished being updated
- int updateTimeoutInSec = Config.Client.Advanced.LodBuilding.minTimeBetweenChunkUpdatesInSeconds.get();
- if (updateTimeoutInSec != 0)
+ catch (Exception e)
{
- // prevent updating this chunk again until the timeout finishes
- CHUNK_UPDATE_TIMER.schedule(new TimerTask()
+ LOGGER.error("Unexpected error when updating chunk at pos: [" + chunkWrapper.getChunkPos() + "]", e);
+ }
+ finally
+ {
+ // the LOD chunk has finished being updated
+ int updateTimeoutInSec = Config.Client.Advanced.LodBuilding.minTimeBetweenChunkUpdatesInSeconds.get();
+ if (updateTimeoutInSec != 0)
{
- @Override
- public void run() { UPDATING_CHUNK_POS_SET.remove(chunkWrapper.getChunkPos()); }
- }, updateTimeoutInSec * 1000L);
+ // prevent updating this chunk again until the timeout finishes
+ CHUNK_UPDATE_TIMER.schedule(new TimerTask()
+ {
+ @Override
+ public void run() { UPDATING_CHUNK_POS_SET.remove(chunkWrapper.getChunkPos()); }
+ }, updateTimeoutInSec * 1000L);
+ }
+ else
+ {
+ // instantly allow this chunk to be updated again
+ UPDATING_CHUNK_POS_SET.remove(chunkWrapper.getChunkPos());
+ }
}
- else
- {
- // instantly allow this chunk to be updated again
- UPDATING_CHUNK_POS_SET.remove(chunkWrapper.getChunkPos());
- }
- }
- });
+ });
+ }
+ catch (RejectedExecutionException ignore) { /* the executor was shut down, it should be back up shortly and able to accept new jobs */ }
}
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 f81eb8ce9..ac2f0bb33 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
@@ -37,7 +37,9 @@ import com.seibel.distanthorizons.coreapi.util.StringUtil;
import org.apache.logging.log4j.Logger;
import javax.swing.*;
+import java.awt.*;
import java.util.*;
+import java.util.List;
/**
@@ -72,8 +74,8 @@ public class Config
public static ConfigLinkedEntry quickLodChunkRenderDistance = new ConfigLinkedEntry(Advanced.Graphics.Quality.lodChunkRenderDistanceRadius);
- public static ConfigEntry qualityPresetSetting = new ConfigEntry.Builder()
- .set(EQualityPreset.MEDIUM) // the default value is set via the listener when accessed
+ public static ConfigEntry qualityPresetSetting = new ConfigEntry.Builder()
+ .set(EDhApiQualityPreset.MEDIUM) // the default value is set via the listener when accessed
.comment(""
+ "Changing this setting will modify a number of different settings that will change the \n"
+ "visual fidelity of the rendered LODs.\n"
@@ -84,8 +86,8 @@ public class Config
.addListener(RenderQualityPresetConfigEventHandler.INSTANCE)
.build();
- public static ConfigEntry threadPresetSetting = new ConfigEntry.Builder()
- .set(EThreadPreset.LOW_IMPACT) // the default value is set via the listener when accessed
+ public static ConfigEntry threadPresetSetting = new ConfigEntry.Builder()
+ .set(EDhApiThreadPreset.LOW_IMPACT) // the default value is set via the listener when accessed
.comment(""
+ "Changing this setting will modify a number of different settings that will change \n"
+ "the load that Distant Horizons is allowed to put on your CPU. \n"
@@ -138,20 +140,20 @@ public class Config
public static class Quality
{
- public static ConfigEntry maxHorizontalResolution = new ConfigEntry.Builder()
- .set(EMaxHorizontalResolution.BLOCK)
+ public static ConfigEntry maxHorizontalResolution = new ConfigEntry.Builder()
+ .set(EDhApiMaxHorizontalResolution.BLOCK)
.comment(""
+ "What is the maximum detail LODs should be drawn at? \n"
+ "Higher settings will increase memory and GPU usage. \n"
+ "\n"
- + EMaxHorizontalResolution.CHUNK + ": render 1 LOD for each Chunk. \n"
- + EMaxHorizontalResolution.HALF_CHUNK + ": render 4 LODs for each Chunk. \n"
- + EMaxHorizontalResolution.FOUR_BLOCKS + ": render 16 LODs for each Chunk. \n"
- + EMaxHorizontalResolution.TWO_BLOCKS + ": render 64 LODs for each Chunk. \n"
- + EMaxHorizontalResolution.BLOCK + ": render 256 LODs for each Chunk (width of one block). \n"
+ + EDhApiMaxHorizontalResolution.CHUNK + ": render 1 LOD for each Chunk. \n"
+ + EDhApiMaxHorizontalResolution.HALF_CHUNK + ": render 4 LODs for each Chunk. \n"
+ + EDhApiMaxHorizontalResolution.FOUR_BLOCKS + ": render 16 LODs for each Chunk. \n"
+ + EDhApiMaxHorizontalResolution.TWO_BLOCKS + ": render 64 LODs for each Chunk. \n"
+ + EDhApiMaxHorizontalResolution.BLOCK + ": render 256 LODs for each Chunk (width of one block). \n"
+ "\n"
- + "Lowest Quality: " + EMaxHorizontalResolution.CHUNK + "\n"
- + "Highest Quality: " + EMaxHorizontalResolution.BLOCK)
+ + "Lowest Quality: " + EDhApiMaxHorizontalResolution.CHUNK + "\n"
+ + "Highest Quality: " + EDhApiMaxHorizontalResolution.BLOCK)
.setPerformance(EConfigEntryPerformance.MEDIUM)
.build();
@@ -161,21 +163,21 @@ public class Config
.setPerformance(EConfigEntryPerformance.HIGH)
.build();
- public static ConfigEntry verticalQuality = new ConfigEntry.Builder()
- .set(EVerticalQuality.MEDIUM)
+ public static ConfigEntry verticalQuality = new ConfigEntry.Builder()
+ .set(EDhApiVerticalQuality.MEDIUM)
.comment(""
+ "This indicates how well LODs will represent \n"
+ "overhangs, caves, floating islands, etc. \n"
+ "Higher options will make the world more accurate, but"
+ "will increase memory and GPU usage. \n"
+ "\n"
- + "Lowest Quality: " + EVerticalQuality.HEIGHT_MAP + "\n"
- + "Highest Quality: " + EVerticalQuality.EXTREME)
+ + "Lowest Quality: " + EDhApiVerticalQuality.HEIGHT_MAP + "\n"
+ + "Highest Quality: " + EDhApiVerticalQuality.EXTREME)
.setPerformance(EConfigEntryPerformance.VERY_HIGH)
.build();
- public static ConfigEntry horizontalQuality = new ConfigEntry.Builder()
- .set(EHorizontalQuality.MEDIUM)
+ public static ConfigEntry horizontalQuality = new ConfigEntry.Builder()
+ .set(EDhApiHorizontalQuality.MEDIUM)
.comment(""
+ "This indicates how quickly LODs decrease in quality the further away they are. \n"
+ "Higher settings will render higher quality fake chunks farther away, \n"
@@ -183,25 +185,25 @@ public class Config
.setPerformance(EConfigEntryPerformance.MEDIUM)
.build();
- public static ConfigEntry transparency = new ConfigEntry.Builder()
- .set(ETransparency.COMPLETE)
+ public static ConfigEntry transparency = new ConfigEntry.Builder()
+ .set(EDhApiTransparency.COMPLETE)
.comment(""
+ "How should LOD transparency be handled. \n"
+ "\n"
- + ETransparency.COMPLETE + ": LODs will render transparent. \n"
- + ETransparency.FAKE + ": LODs will be opaque, but shaded to match the blocks underneath. \n"
- + ETransparency.DISABLED + ": LODs will be opaque. \n"
+ + EDhApiTransparency.COMPLETE + ": LODs will render transparent. \n"
+ + EDhApiTransparency.FAKE + ": LODs will be opaque, but shaded to match the blocks underneath. \n"
+ + EDhApiTransparency.DISABLED + ": LODs will be opaque. \n"
+ "")
.setPerformance(EConfigEntryPerformance.MEDIUM)
.build();
- public static ConfigEntry blocksToIgnore = new ConfigEntry.Builder()
- .set(EBlocksToAvoid.NON_COLLIDING)
+ public static ConfigEntry blocksToIgnore = new ConfigEntry.Builder()
+ .set(EDhApiBlocksToAvoid.NON_COLLIDING)
.comment(""
+ "What blocks shouldn't be rendered as LODs? \n"
+ "\n"
- + EBlocksToAvoid.NONE + ": Represent all blocks in the LODs \n"
- + EBlocksToAvoid.NON_COLLIDING + ": Only represent solid blocks in the LODs (tall grass, torches, etc. won't count for a LOD's height) \n"
+ + EDhApiBlocksToAvoid.NONE + ": Represent all blocks in the LODs \n"
+ + EDhApiBlocksToAvoid.NON_COLLIDING + ": Only represent solid blocks in the LODs (tall grass, torches, etc. won't count for a LOD's height) \n"
+ "")
.setPerformance(EConfigEntryPerformance.NONE)
.build();
@@ -234,33 +236,27 @@ public class Config
public static class Fog
{
- public static ConfigEntry drawMode = new ConfigEntry.Builder()
- .set(EFogDrawMode.FOG_ENABLED)
+ public static ConfigEntry drawMode = new ConfigEntry.Builder()
+ .set(EDhApiFogDrawMode.FOG_ENABLED)
.comment(""
+ "When should fog be drawn? \n"
+ "\n"
- + EFogDrawMode.USE_OPTIFINE_SETTING + ": Use whatever Fog setting Optifine is using.\n"
- + "If Optifine isn't installed this defaults to " + EFogDrawMode.FOG_ENABLED + ". \n"
- + EFogDrawMode.FOG_ENABLED + ": Never draw fog on the LODs \n"
- + EFogDrawMode.FOG_DISABLED + ": Always draw fast fog on the LODs \n"
+ + EDhApiFogDrawMode.USE_OPTIFINE_SETTING + ": Use whatever Fog setting Optifine is using.\n"
+ + "If Optifine isn't installed this defaults to " + EDhApiFogDrawMode.FOG_ENABLED + ". \n"
+ + EDhApiFogDrawMode.FOG_ENABLED + ": Never draw fog on the LODs \n"
+ + EDhApiFogDrawMode.FOG_DISABLED + ": Always draw fast fog on the LODs \n"
+ "\n"
+ "Disabling fog will improve GPU performance.")
.setPerformance(EConfigEntryPerformance.VERY_LOW)
.build();
- public static ConfigEntry distance = new ConfigEntry.Builder()
- .set(EFogDistance.FAR)
- .comment("At what distance should Fog be drawn on the LODs?")
- .setPerformance(EConfigEntryPerformance.NONE)
- .build();
-
- public static ConfigEntry colorMode = new ConfigEntry.Builder()
- .set(EFogColorMode.USE_WORLD_FOG_COLOR)
+ public static ConfigEntry colorMode = new ConfigEntry.Builder()
+ .set(EDhApiFogColorMode.USE_WORLD_FOG_COLOR)
.comment(""
+ "What color should fog use? \n"
+ "\n"
- + EFogColorMode.USE_WORLD_FOG_COLOR + ": Use the world's fog color. \n"
- + EFogColorMode.USE_SKY_COLOR + ": Use the sky's color.")
+ + EDhApiFogColorMode.USE_WORLD_FOG_COLOR + ": Use the world's fog color. \n"
+ + EDhApiFogColorMode.USE_SKY_COLOR + ": Use the sky's color.")
.setPerformance(EConfigEntryPerformance.NONE)
.build();
@@ -320,14 +316,14 @@ public class Config
+ "1.0: Fully opaque fog.")
.build();
- public static ConfigEntry farFogFalloff = new ConfigEntry.Builder()
- .set(EFogFalloff.EXPONENTIAL_SQUARED)
+ public static ConfigEntry farFogFalloff = new ConfigEntry.Builder()
+ .set(EDhApiFogFalloff.EXPONENTIAL_SQUARED)
.comment(""
+ "How should the fog thickness should be calculated? \n"
+ "\n"
- + EFogFalloff.LINEAR + ": Linear based on distance (will ignore 'density')\n"
- + EFogFalloff.EXPONENTIAL + ": 1/(e^(distance*density)) \n"
- + EFogFalloff.EXPONENTIAL_SQUARED + ": 1/(e^((distance*density)^2)")
+ + EDhApiFogFalloff.LINEAR + ": Linear based on distance (will ignore 'density')\n"
+ + EDhApiFogFalloff.EXPONENTIAL + ": 1/(e^(distance*density)) \n"
+ + EDhApiFogFalloff.EXPONENTIAL_SQUARED + ": 1/(e^((distance*density)^2)")
.build();
public static ConfigEntry farFogDensity = new ConfigEntry.Builder()
@@ -343,37 +339,37 @@ public class Config
public static class HeightFog
{
- public static ConfigEntry heightFogMixMode = new ConfigEntry.Builder()
- .set(EHeightFogMixMode.BASIC)
+ public static ConfigEntry heightFogMixMode = new ConfigEntry.Builder()
+ .set(EDhApiHeightFogMixMode.BASIC)
.comment(""
+ "How should height effect the fog thickness? \n"
+ "Note: height fog is combined with the other fog settings. \n"
+ "\n"
- + EHeightFogMixMode.BASIC + ": No special height fog effect. Fog is calculated based on camera distance \n"
- + EHeightFogMixMode.IGNORE_HEIGHT + ": Ignore height completely. Fog is only calculated with horizontal distance \n"
- + EHeightFogMixMode.ADDITION + ": heightFog + farFog \n"
- + EHeightFogMixMode.MAX + ": max(heightFog, farFog) \n"
- + EHeightFogMixMode.MULTIPLY + ": heightFog * farFog \n"
- + EHeightFogMixMode.INVERSE_MULTIPLY + ": 1 - (1-heightFog) * (1-farFog) \n"
- + EHeightFogMixMode.LIMITED_ADDITION + ": farFog + max(farFog, heightFog) \n"
- + EHeightFogMixMode.MULTIPLY_ADDITION + ": farFog + farFog * heightFog \n"
- + EHeightFogMixMode.INVERSE_MULTIPLY_ADDITION + ": farFog + 1 - (1-heightFog) * (1-farFog) \n"
- + EHeightFogMixMode.AVERAGE + ": farFog*0.5 + heightFog*0.5 \n"
+ + EDhApiHeightFogMixMode.BASIC + ": No special height fog effect. Fog is calculated based on camera distance \n"
+ + EDhApiHeightFogMixMode.IGNORE_HEIGHT + ": Ignore height completely. Fog is only calculated with horizontal distance \n"
+ + EDhApiHeightFogMixMode.ADDITION + ": heightFog + farFog \n"
+ + EDhApiHeightFogMixMode.MAX + ": max(heightFog, farFog) \n"
+ + EDhApiHeightFogMixMode.MULTIPLY + ": heightFog * farFog \n"
+ + EDhApiHeightFogMixMode.INVERSE_MULTIPLY + ": 1 - (1-heightFog) * (1-farFog) \n"
+ + EDhApiHeightFogMixMode.LIMITED_ADDITION + ": farFog + max(farFog, heightFog) \n"
+ + EDhApiHeightFogMixMode.MULTIPLY_ADDITION + ": farFog + farFog * heightFog \n"
+ + EDhApiHeightFogMixMode.INVERSE_MULTIPLY_ADDITION + ": farFog + 1 - (1-heightFog) * (1-farFog) \n"
+ + EDhApiHeightFogMixMode.AVERAGE + ": farFog*0.5 + heightFog*0.5 \n"
+ "\n"
- + "Note: height fog settings are ignored if '" + EHeightFogMixMode.BASIC + "' or '" + EHeightFogMixMode.IGNORE_HEIGHT + "' are selected.")
+ + "Note: height fog settings are ignored if '" + EDhApiHeightFogMixMode.BASIC + "' or '" + EDhApiHeightFogMixMode.IGNORE_HEIGHT + "' are selected.")
.build();
- public static ConfigEntry heightFogMode = new ConfigEntry.Builder()
- .set(EHeightFogMode.ABOVE_AND_BELOW_CAMERA)
+ public static ConfigEntry heightFogMode = new ConfigEntry.Builder()
+ .set(EDhApiHeightFogMode.ABOVE_AND_BELOW_CAMERA)
.comment(""
+ "Where should the height fog start? \n"
+ "\n"
- + EHeightFogMode.ABOVE_CAMERA + ": Height fog starts at the camera and goes towards the sky \n"
- + EHeightFogMode.BELOW_CAMERA + ": Height fog starts at the camera and goes towards the void \n"
- + EHeightFogMode.ABOVE_AND_BELOW_CAMERA + ": Height fog starts from the camera to goes towards both the sky and void \n"
- + EHeightFogMode.ABOVE_SET_HEIGHT + ": Height fog starts from a set height and goes towards the sky \n"
- + EHeightFogMode.BELOW_SET_HEIGHT + ": Height fog starts from a set height and goes towards the void \n"
- + EHeightFogMode.ABOVE_AND_BELOW_SET_HEIGHT + ": Height fog starts from a set height and goes towards both the sky and void")
+ + EDhApiHeightFogMode.ABOVE_CAMERA + ": Height fog starts at the camera and goes towards the sky \n"
+ + EDhApiHeightFogMode.BELOW_CAMERA + ": Height fog starts at the camera and goes towards the void \n"
+ + EDhApiHeightFogMode.ABOVE_AND_BELOW_CAMERA + ": Height fog starts from the camera to goes towards both the sky and void \n"
+ + EDhApiHeightFogMode.ABOVE_SET_HEIGHT + ": Height fog starts from a set height and goes towards the sky \n"
+ + EDhApiHeightFogMode.BELOW_SET_HEIGHT + ": Height fog starts from a set height and goes towards the void \n"
+ + EDhApiHeightFogMode.ABOVE_AND_BELOW_SET_HEIGHT + ": Height fog starts from a set height and goes towards both the sky and void")
.build();
public static ConfigEntry heightFogBaseHeight = new ConfigEntry.Builder()
@@ -417,14 +413,14 @@ public class Config
+ "1.0: Fully opaque fog.")
.build();
- public static ConfigEntry heightFogFalloff = new ConfigEntry.Builder()
- .set(EFogFalloff.EXPONENTIAL_SQUARED)
+ public static ConfigEntry heightFogFalloff = new ConfigEntry.Builder()
+ .set(EDhApiFogFalloff.EXPONENTIAL_SQUARED)
.comment(""
+ "How should the height fog thickness should be calculated? \n"
+ "\n"
- + EFogFalloff.LINEAR + ": Linear based on height (will ignore 'density')\n"
- + EFogFalloff.EXPONENTIAL + ": 1/(e^(height*density)) \n"
- + EFogFalloff.EXPONENTIAL_SQUARED + ": 1/(e^((height*density)^2)")
+ + EDhApiFogFalloff.LINEAR + ": Linear based on height (will ignore 'density')\n"
+ + EDhApiFogFalloff.EXPONENTIAL + ": 1/(e^(height*density)) \n"
+ + EDhApiFogFalloff.EXPONENTIAL_SQUARED + ": 1/(e^((height*density)^2)")
.build();
public static ConfigEntry heightFogDensity = new ConfigEntry.Builder()
@@ -534,18 +530,6 @@ public class Config
public static class AdvancedGraphics
{
- /**
- * @deprecated Use overdrawPrevention instead, will be removed when DH updates to MC 1.21
- * After removal a float value will be used to control overdraw instead.
- */
- @Deprecated
- public static ConfigEntry overdrawPreventionPreset = new ConfigEntry.Builder()
- .set(EOverdrawPrevention.MEDIUM)
- .comment("")
- .setAppearance(EConfigEntryAppearance.ONLY_IN_API)
- .setPerformance(EConfigEntryPerformance.NONE)
- .build();
-
public static ConfigEntry overdrawPrevention = new ConfigEntry.Builder()
.setMinDefaultMax(0.0, 0.4, 1.0)
.comment(""
@@ -561,21 +545,6 @@ public class Config
.setPerformance(EConfigEntryPerformance.NONE)
.build();
- @Deprecated // TODO remove failed experiment
- public static ConfigEntry seamlessOverdraw = new ConfigEntry.Builder()
- .set(false)
- .comment(""
- + "Buggy experimental option that will attempt to match up \n"
- + "Distant Horizons' and Minecraft's near/far clip planes, \n"
- + "reducing overdraw. \n"
- + "\n"
- + "Only functional on Fabric.\n"
- + "Works best with an overdraw prevention setting of " + EOverdrawPrevention.MEDIUM + " or higher \n"
- + " and cave culling is disabled. \n"
- + "")
- .setPerformance(EConfigEntryPerformance.NONE)
- .build();
-
// move into "shader compatibility"
public static ConfigEntry brightnessMultiplier = new ConfigEntry.Builder() // TODO: Make this a float (the ClassicConfigGUI doesnt support floats)
.set(1.0)
@@ -641,15 +610,15 @@ public class Config
+ "If set to 0 the mod wont overwrite vanilla's default (which so happens to also be 0)")
.build();
- public static ConfigEntry lodShading = new ConfigEntry.Builder()
- .set(ELodShading.MINECRAFT)
+ public static ConfigEntry lodShading = new ConfigEntry.Builder()
+ .set(EDhApiLodShading.AUTO)
.comment(""
+ "How should LODs be shaded? \n"
+ "\n"
- + ELodShading.MINECRAFT + ": Uses the same side shading as vanilla Minecraft blocks. \n"
- + ELodShading.OLD_LIGHTING + ": Simulates Minecraft's block shading for LODs. \n"
+ + EDhApiLodShading.AUTO + ": Uses the same side shading as vanilla Minecraft blocks. \n"
+ + EDhApiLodShading.ENABLED + ": Simulates Minecraft's block shading for LODs. \n"
+ " Can be used to force LOD shading when using some shaders. \n"
- + ELodShading.NONE + ": All LOD sides will be rendered with the same brightness. \n"
+ + EDhApiLodShading.DISABLED + ": All LOD sides will be rendered with the same brightness. \n"
+ "")
.setPerformance(EConfigEntryPerformance.NONE)
.build();
@@ -676,6 +645,17 @@ public class Config
+ "Disable this if shadows render incorrectly.")
.build();
+ public static ConfigEntry grassSideRendering = new ConfigEntry.Builder()
+ .set(EDhApiGrassSideRendering.FADE_TO_DIRT)
+ .comment(""
+ + "How should the sides and bottom of grass block LODs render? \n"
+ + "\n"
+ + EDhApiGrassSideRendering.AS_GRASS + ": all sides of dirt LOD's render using the top (green) color. \n"
+ + EDhApiGrassSideRendering.FADE_TO_DIRT + ": sides fade from grass to dirt. \n"
+ + EDhApiGrassSideRendering.AS_DIRT + ": sides render entirely as dirt. \n"
+ + "")
+ .setPerformance(EConfigEntryPerformance.NONE)
+ .build();
}
@@ -743,36 +723,6 @@ public class Config
+ "")
.build();
- // deprecated and not implemented, can be made public if we ever re-implement it
- @Deprecated
- private static ConfigEntry generationPriority = new ConfigEntry.Builder()
- .set(EGenerationPriority.NEAR_FIRST)
- .comment(""
- + "In what priority should fake chunks be generated outside the vanilla render distance? \n"
- + "\n"
- + EGenerationPriority.FAR_FIRST + " \n"
- + "Fake chunks are generated from lowest to highest detail \n"
- + " with a priority for far away regions. \n"
- + "This fills in the world fastest, but you will have large low detail \n"
- + " blocks for a while while the generation happens. \n"
- + "\n"
- + EGenerationPriority.NEAR_FIRST + " \n"
- + "Fake chunks are generated around the player \n"
- + " in a spiral, similar to vanilla minecraft. \n"
- + "Best used when on a server since we can't generate \n"
- + " fake chunks. \n"
- + "\n"
- + EGenerationPriority.BALANCED + " \n"
- + "A mix between " + EGenerationPriority.NEAR_FIRST + "and" + EGenerationPriority.FAR_FIRST + ". \n"
- + "First prioritise completing nearby highest detail chunks, \n"
- + " then focus on filling in the low detail areas away from the player. \n"
- + "\n"
- + EGenerationPriority.AUTO + " \n"
- + "Uses " + EGenerationPriority.BALANCED + " when on a single player world \n"
- + " and " + EGenerationPriority.NEAR_FIRST + " when connected to a server.")
- .setPerformance(EConfigEntryPerformance.NONE)
- .build();
-
}
public static class LodBuilding
@@ -801,19 +751,81 @@ public class Config
+ "")
.build();
+ public static ConfigEntry dataCompression = new ConfigEntry.Builder()
+ .set(EDhApiDataCompressionMode.LZMA2)
+ .comment(""
+ + "What algorithm should be used to compress new LOD data? \n"
+ + "This setting will only affect new or updated LOD data, \n"
+ + "any data already generated when this setting is changed will be\n"
+ + "unaffected until it needs to be re-written to the database.\n"
+ + "\n"
+ + EDhApiDataCompressionMode.UNCOMPRESSED + " \n"
+ + "Should only be used for testing, is worse in every way vs ["+EDhApiDataCompressionMode.LZ4+"].\n"
+ + "Expected Compression Ratio: 1.0\n"
+ + "Estimated average DTO read speed: 1.64 milliseconds\n"
+ + "Estimated average DTO write speed: 12.44 milliseconds\n"
+ + "\n"
+ + EDhApiDataCompressionMode.LZ4 + " \n"
+ + "A good option if you're CPU limited and have plenty of hard drive space.\n"
+ + "Expected Compression Ratio: 0.36\n"
+ + "Estimated average DTO read speed: 1.85 ms\n"
+ + "Estimated average DTO write speed: 9.46 ms\n"
+ + "\n"
+ + EDhApiDataCompressionMode.Z_STD + " \n"
+ + "A good middle ground between speed and compression.\n"
+ + "Expected Compression Ratio: 0.21\n"
+ + "Estimated average DTO read speed: 11.78 ms\n"
+ + "Estimated average DTO write speed: 16.77 ms\n"
+ + "\n"
+ + EDhApiDataCompressionMode.LZMA2 + " \n"
+ + "Slow but very good compression.\n"
+ + "Expected Compression Ratio: 0.14\n"
+ + "Estimated average DTO read speed: 11.89 ms\n"
+ + "Estimated average DTO write speed: 192.01 ms\n"
+ + "")
+ .build();
+
+ public static ConfigEntry worldCompression = new ConfigEntry.Builder()
+ .set(EDhApiWorldCompressionMode.VISUALLY_EQUAL)
+ .comment(""
+ + "How should block data be compressed when creating LOD data? \n"
+ + "This setting will only affect new or updated LOD data, \n"
+ + "any data already generated when this setting is changed will be\n"
+ + "unaffected until it is modified or re-loaded.\n"
+ + "\n"
+ + EDhApiWorldCompressionMode.MERGE_SAME_BLOCKS + " \n"
+ + "Every block/biome change is recorded in the database. \n"
+ + "This is what DH 2.0 and 2.0.1 all used by default and will store a lot of data. \n"
+ + "Expected Compression Ratio: 1.0\n"
+ + "\n"
+ + EDhApiWorldCompressionMode.VISUALLY_EQUAL + " \n"
+ + "Only visible block/biome changes are recorded in the database. \n"
+ + "Hidden blocks (IE ores) are ignored. \n"
+ + "Expected Compression Ratio: 0.7\n"
+ + "")
+ .build();
+
+ public static ConfigEntry showMigrationChatWarning = new ConfigEntry.Builder()
+ .set(true)
+ .comment(""
+ + "Determines if a message should be displayed in the chat when LOD migration starts. \n"
+ + "")
+ .build();
+
}
public static class Multiplayer
{
- public static ConfigEntry serverFolderNameMode = new ConfigEntry.Builder()
- .set(EServerFolderNameMode.NAME_ONLY)
+ public static ConfigEntry serverFolderNameMode = new ConfigEntry.Builder()
+ .set(EDhApiServerFolderNameMode.NAME_ONLY)
.comment(""
+ "How should multiplayer save folders should be named? \n"
+ "\n"
- + EServerFolderNameMode.NAME_ONLY + ": Example: \"Minecraft Server\" \n"
- + EServerFolderNameMode.NAME_IP + ": Example: \"Minecraft Server IP 192.168.1.40\" \n"
- + EServerFolderNameMode.NAME_IP_PORT + ": Example: \"Minecraft Server IP 192.168.1.40:25565\""
- + EServerFolderNameMode.NAME_IP_PORT_MC_VERSION + ": Example: \"Minecraft Server IP 192.168.1.40:25565 GameVersion 1.16.5\"")
+ + EDhApiServerFolderNameMode.NAME_ONLY + ": Example: \"Minecraft Server\" \n"
+ + EDhApiServerFolderNameMode.IP_ONLY + ": Example: \"192.168.1.40\" \n"
+ + EDhApiServerFolderNameMode.NAME_IP + ": Example: \"Minecraft Server IP 192.168.1.40\" \n"
+ + EDhApiServerFolderNameMode.NAME_IP_PORT + ": Example: \"Minecraft Server IP 192.168.1.40:25565\""
+ + EDhApiServerFolderNameMode.NAME_IP_PORT_MC_VERSION + ": Example: \"Minecraft Server IP 192.168.1.40:25565 GameVersion 1.16.5\"")
.build();
public static ConfigEntry multiverseSimilarityRequiredPercent = new ConfigEntry.Builder()
@@ -907,7 +919,7 @@ public class Config
ThreadPresetConfigEventHandler.getFileHandlerDefaultThreadCount(),
Runtime.getRuntime().availableProcessors())
.comment(""
- + "How many threads should be used when reading in LOD data from disk? \n"
+ + "How many threads should be used when reading/writing LOD data to/from disk? \n"
+ "\n"
+ "Increasing this number will cause LODs to load in faster, \n"
+ "but may cause lag when loading a new world or when \n"
@@ -920,6 +932,31 @@ public class Config
.comment(THREAD_RUN_TIME_RATIO_NOTE)
.build();
+ public static final ConfigEntry numberOfUpdatePropagatorThreads = new ConfigEntry.Builder()
+ .setMinDefaultMax(1,
+ ThreadPresetConfigEventHandler.getUpdatePropagatorDefaultThreadCount(),
+ Runtime.getRuntime().availableProcessors())
+ .comment(""
+ + "How many threads should be used when applying LOD updates? \n"
+ + "An LOD update is the operation of down-sampling a high detail LOD \n"
+ + "into a lower detail one.\n"
+ + "\n"
+ + "This config can have a much higher number of threads \n"
+ + "assigned and much lower run time ratio vs other thread pools \n"
+ + "because the amount of time any particular thread may run is relatively low.\n"
+ + "\n"
+ + "This is because LOD updating only only partially thread safe, \n"
+ + "so between 40% and 60% of the time a given thread may end up \n"
+ + "waiting on another thread to finish updating the same LOD it also wants\n"
+ + "to work on.\n"
+ + "\n"
+ + THREAD_NOTE)
+ .build();
+ public static final ConfigEntry runTimeRatioForUpdatePropagatorThreads = new ConfigEntry.Builder()
+ .setMinDefaultMax(0.01, ThreadPresetConfigEventHandler.getUpdatePropagatorDefaultRunTimeRatio(), 1.0)
+ .comment(THREAD_RUN_TIME_RATIO_NOTE)
+ .build();
+
public static final ConfigEntry numberOfLodBuilderThreads = new ConfigEntry.Builder()
.setMinDefaultMax(1,
ThreadPresetConfigEventHandler.getLodBuilderDefaultThreadCount(),
@@ -950,27 +987,27 @@ public class Config
public static class GpuBuffers
{
- public static ConfigEntry gpuUploadMethod = new ConfigEntry.Builder()
- .set(EGpuUploadMethod.AUTO)
+ public static ConfigEntry gpuUploadMethod = new ConfigEntry.Builder()
+ .set(EDhApiGpuUploadMethod.AUTO)
.comment(""
+ "What method should be used to upload geometry to the GPU? \n"
+ "\n"
- + EGpuUploadMethod.AUTO + ": Picks the best option based on the GPU you have. \n"
+ + EDhApiGpuUploadMethod.AUTO + ": Picks the best option based on the GPU you have. \n"
+ "\n"
- + EGpuUploadMethod.BUFFER_STORAGE + ": Default if OpenGL 4.5 is supported. \n"
+ + EDhApiGpuUploadMethod.BUFFER_STORAGE + ": Default if OpenGL 4.5 is supported. \n"
+ " Fast rendering, no stuttering. \n"
+ "\n"
- + EGpuUploadMethod.SUB_DATA + ": Backup option for NVIDIA. \n"
+ + EDhApiGpuUploadMethod.SUB_DATA + ": Backup option for NVIDIA. \n"
+ " Fast rendering but may stutter when uploading. \n"
+ "\n"
- + EGpuUploadMethod.BUFFER_MAPPING + ": Slow rendering but won't stutter when uploading. \n"
+ + EDhApiGpuUploadMethod.BUFFER_MAPPING + ": Slow rendering but won't stutter when uploading. \n"
+ " Generally the best option for integrated GPUs. \n"
+ " Default option for AMD/Intel if OpenGL 4.5 isn't supported. \n"
+ " May end up storing buffers in System memory. \n"
+ " Fast rendering if in GPU memory, slow if in system memory, \n"
+ " but won't stutter when uploading. \n"
+ "\n"
- + EGpuUploadMethod.DATA + ": Fast rendering but will stutter when uploading. \n"
+ + EDhApiGpuUploadMethod.DATA + ": Fast rendering but will stutter when uploading. \n"
+ " Backup option for AMD/Intel. \n"
+ " Fast rendering but may stutter when uploading. \n"
+ "\n"
@@ -1003,15 +1040,6 @@ public class Config
+ "")
.build();
- // deprecated and not implemented, can be made public if we ever re-implement it
- @Deprecated
- private static ConfigEntry rebuildTimes = new ConfigEntry.Builder()
- .set(EBufferRebuildTimes.NORMAL)
- .comment(""
- + "How frequently should vertex buffers (geometry) be rebuilt and sent to the GPU? \n"
- + "Higher settings may cause stuttering, but will prevent holes in the world")
- .build();
-
}
public static class AutoUpdater
@@ -1030,9 +1058,9 @@ public class Config
+ "Should Distant Horizons silently, automatically download and install new versions?")
.build();
- public static ConfigEntry updateBranch = new ConfigEntry.Builder()
+ public static ConfigEntry updateBranch = new ConfigEntry.Builder()
.set(
- ModInfo.IS_DEV_BUILD? EUpdateBranch.NIGHTLY: EUpdateBranch.STABLE // If it's already a nightly build, then download the nightly build ofc
+ ModInfo.IS_DEV_BUILD? EDhApiUpdateBranch.NIGHTLY: EDhApiUpdateBranch.STABLE // If it's already a nightly build, then download the nightly build ofc
)
.comment(""
+ " If DH should use the nightly (provided by Gitlab), or stable (provided by Modrinth) build")
@@ -1043,64 +1071,64 @@ public class Config
{
// TODO add change all option
// TODO default to error chat and info file
- public static ConfigEntry logWorldGenEvent = new ConfigEntry.Builder()
- .set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE)
+ public static ConfigEntry logWorldGenEvent = new ConfigEntry.Builder()
+ .set(EDhApiLoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE)
.comment(""
+ "If enabled, the mod will log information about the world generation process. \n"
+ "This can be useful for debugging.")
.build();
- public static ConfigEntry logWorldGenPerformance = new ConfigEntry.Builder()
- .set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_FILE)
+ public static ConfigEntry logWorldGenPerformance = new ConfigEntry.Builder()
+ .set(EDhApiLoggerMode.LOG_WARNING_TO_CHAT_AND_FILE)
.comment(""
+ "If enabled, the mod will log performance about the world generation process. \n"
+ "This can be useful for debugging.")
.build();
- public static ConfigEntry logWorldGenLoadEvent = new ConfigEntry.Builder()
- .set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_FILE)
+ public static ConfigEntry logWorldGenLoadEvent = new ConfigEntry.Builder()
+ .set(EDhApiLoggerMode.LOG_WARNING_TO_CHAT_AND_FILE)
.comment(""
+ "If enabled, the mod will log information about the world generation process. \n"
+ "This can be useful for debugging.")
.build();
- public static ConfigEntry logLodBuilderEvent = new ConfigEntry.Builder()
- .set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE)
+ public static ConfigEntry logLodBuilderEvent = new ConfigEntry.Builder()
+ .set(EDhApiLoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE)
.comment(""
+ "If enabled, the mod will log information about the LOD generation process. \n"
+ "This can be useful for debugging.")
.build();
- public static ConfigEntry logRendererBufferEvent = new ConfigEntry.Builder()
- .set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE)
+ public static ConfigEntry logRendererBufferEvent = new ConfigEntry.Builder()
+ .set(EDhApiLoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE)
.comment(""
+ "If enabled, the mod will log information about the renderer buffer process. \n"
+ "This can be useful for debugging.")
.build();
- public static ConfigEntry logRendererGLEvent = new ConfigEntry.Builder()
- .set(ELoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE)
+ public static ConfigEntry logRendererGLEvent = new ConfigEntry.Builder()
+ .set(EDhApiLoggerMode.LOG_WARNING_TO_CHAT_AND_INFO_TO_FILE)
.comment(""
+ "If enabled, the mod will log information about the renderer OpenGL process. \n"
+ "This can be useful for debugging.")
.build();
- public static ConfigEntry