This commit is contained in:
s809
2024-05-02 21:47:35 +05:00
211 changed files with 8858 additions and 8280 deletions
@@ -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 <https://www.gnu.org/licenses/>.
*/
package com.seibel.distanthorizons.api.enums.config;
/**
* CONSTANT <br>
* FREQUENT <br>
* NORMAL <br>
* RARE <br> <br>
*
* 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;
}
}
@@ -23,9 +23,10 @@ package com.seibel.distanthorizons.api.enums.config;
* NONE, <br>
* NON_COLLIDING, <br>
*
* @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; }
}
@@ -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 <https://www.gnu.org/licenses/>.
*/
package com.seibel.distanthorizons.api.enums.config;
/**
* UNCOMPRESSED <br>
* LZ4 <br>
* ZSTD <br>
* XZ <br><br>
*
* 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. <br><br>
*
* Read Speed: 1.64 MS / DTO <br>
* Write Speed: 12.44 MS / DTO <br>
* Compression ratio: 1.0 <br>
*/
@DisallowSelectingViaConfigGui
UNCOMPRESSED(0),
/**
* Extremely fast (often faster than uncompressed), but generally poor compression. <br><br>
*
* Read Speed: 1.85 MS / DTO <br>
* Write Speed: 9.46 MS / DTO <br>
* Compression ratio: 0.3638 <br>
*/
LZ4(1),
/**
* Decent speed and good compression. <br><br>
*
* Read Speed: 11.78 MS / DTO <br>
* Write Speed: 16.76 MS / DTO <br>
* Compression ratio: 0.2199 <br>
*/
Z_STD(2),
/**
* Extremely slow, but very good compression. <br><br>
*
* Read Speed: 12.25 MS / DTO <br>
* Write Speed: 490.07 MS / DTO <br>
* Compression ratio: 0.1242 <br>
*/
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+"]");
}
}
@@ -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,
@@ -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,
@@ -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;
@@ -20,21 +20,21 @@
package com.seibel.distanthorizons.api.enums.config;
/**
* DISTANT_HORIZONS, <br>
* MINECRAFT,
* AS_GRASS <br>
* FADE_TO_DIRT <br>
* AS_DIRT <br>
*
* @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;
}
@@ -26,9 +26,10 @@ package com.seibel.distanthorizons.api.enums.config;
* HIGH <br>
* UNLIMITED <br>
*
* @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;
@@ -20,27 +20,33 @@
package com.seibel.distanthorizons.api.enums.config;
/**
* MINECRAFT <br>
* OLD_LIGHTING <br>
* NONE <br>
* AUTO <br>
* ENABLED <br>
* DISABLED <br>
*
* @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. <Br>
* This means if Minecraft's shading is disabled DH's shading will be as well.
*/
AUTO,
/**
* Simulates Minecraft's shading. <Br>
* 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;
}
@@ -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;
}
}
@@ -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 <br>
* 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<EMaxHorizontalResolution> lowerDetails = new ArrayList<>();
ArrayList<EDhApiMaxHorizontalResolution> 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);
@@ -22,6 +22,7 @@ package com.seibel.distanthorizons.api.enums.config;
/**
* NAME_ONLY, <br>
* IP_ONLY, <br>
* NAME_IP, <br>
* NAME_IP_PORT, <br>
* NAME_IP_PORT_MC_VERSION, <br> <br>
@@ -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} <br>
* Example: Minecraft Server IP 192.168.1.40
@@ -0,0 +1,14 @@
package com.seibel.distanthorizons.api.enums.config;
/**
* STABLE, <br>
* NIGHTLY, <br><br>
*
* @since API 1.1.0
* @version 2024-4-6
*/
public enum EDhApiUpdateBranch
{
STABLE,
NIGHTLY
}
@@ -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
@@ -29,23 +29,25 @@ import com.seibel.distanthorizons.coreapi.util.MathUtil;
* EXTREME <br>
*
* @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; }
@@ -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 <https://www.gnu.org/licenses/>.
*/
package com.seibel.distanthorizons.api.enums.config;
/**
* MERGE_SAME_BLOCKS <br>
* VISUALLY_EQUAL <br><br>
*
* @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. <br>
* 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. <Br>
* 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+"]");
}
}
@@ -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 <https://www.gnu.org/licenses/>.
*/
package com.seibel.distanthorizons.api.enums.config;
/**
* AUTO <br>
* Near_First <br>
* Far_First <br> <br>
*
* 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
}
@@ -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 <https://www.gnu.org/licenses/>.
*/
package com.seibel.distanthorizons.api.enums.config;
/**
* NONE <br>
* LIGHT <br>
* MEDIUM <br>
* HEAVY <br>
*
* CUSTOM <br>
*
* @since API 1.0.0
* @deprecated will be removed when DH updates to MC 1.21 <br>
* 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. <br>
* Is returned if the overdraw value doesn't match any of the enums defined here.
*/
CUSTOM;
}
@@ -1,7 +0,0 @@
package com.seibel.distanthorizons.api.enums.config;
public enum EUpdateBranch
{
STABLE,
NIGHTLY
}
@@ -30,9 +30,10 @@ import com.seibel.distanthorizons.api.enums.config.DisallowSelectingViaConfigGui
* HIGH, <br>
* EXTREME, <br>
*
* @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
@@ -29,9 +29,10 @@ import com.seibel.distanthorizons.api.enums.config.DisallowSelectingViaConfigGui
* BALANCED, <br>
* AGGRESSIVE, <br>
*
* @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,
}
@@ -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;
@@ -24,10 +24,10 @@ package com.seibel.distanthorizons.api.enums.rendering;
* USE_SKY_COLOR, <br>
*
* @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,
}
@@ -25,10 +25,10 @@ package com.seibel.distanthorizons.api.enums.rendering;
* FOG_DISABLED <br>
*
* @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
@@ -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
}
@@ -32,10 +32,10 @@ package com.seibel.distanthorizons.api.enums.rendering;
* AVERAGE <br>
*
* @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,
@@ -28,10 +28,10 @@ package com.seibel.distanthorizons.api.enums.rendering;
* ABOVE_AND_BELOW_SET_HEIGHT, <br>
*
* @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;
@@ -24,10 +24,10 @@ package com.seibel.distanthorizons.api.enums.rendering;
* Debug <br>
* Disabled <br>
*
* @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)
{
@@ -24,9 +24,10 @@ package com.seibel.distanthorizons.api.enums.rendering;
* FAKE, <br>
* COMPLETE, <br>
*
* @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;
@@ -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 <https://www.gnu.org/licenses/>.
*/
package com.seibel.distanthorizons.api.enums.rendering;
/**
* NEAR, <br>
* FAR, <br>
* NEAR_AND_FAR <br>
*
* @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
}
@@ -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;
@@ -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;
@@ -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<EDebugRendering> debugRendering();
IDhApiConfigValue<EDhApiDebugRendering> debugRendering();
/** If enabled debug keybindings can be used. */
IDhApiConfigValue<Boolean> debugKeybindings();
@@ -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<Double> farFogMaxThickness();
/** Defines how the fog changes in thickness. */
IDhApiConfigValue<EFogFalloff> farFogFalloff();
IDhApiConfigValue<EDhApiFogFalloff> farFogFalloff();
/** Defines the fog density. */
IDhApiConfigValue<Double> farFogDensity();
@@ -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<EFogDistance> distance();
/** Should be used to enable/disable fog rendering. */
IDhApiConfigValue<EFogDrawMode> drawMode();
IDhApiConfigValue<EDhApiFogDrawMode> drawMode();
/** Can be used to enable support with mods that change vanilla MC's fog color. */
IDhApiConfigValue<EFogColorMode> color();
IDhApiConfigValue<EDhApiFogColorMode> color();
/**
* If enabled attempts to disable vanilla MC's fog on real chunks. <br>
@@ -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<EGpuUploadMethod> gpuUploadMethod();
IDhApiConfigValue<EDhApiGpuUploadMethod> gpuUploadMethod();
/**
* Defines how long we should wait after uploading one
@@ -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<ERendererMode> renderingMode();
IDhApiConfigValue<EDhApiRendererMode> renderingMode();
@@ -77,18 +76,18 @@ public interface IDhApiGraphicsConfig extends IDhApiConfigGroup
//==================//
/** Defines how detailed fake chunks are in the horizontal direction */
IDhApiConfigValue<EMaxHorizontalResolution> maxHorizontalResolution();
IDhApiConfigValue<EDhApiMaxHorizontalResolution> maxHorizontalResolution();
/** Defines how detailed fake chunks are in the vertical direction */
IDhApiConfigValue<EVerticalQuality> verticalQuality();
IDhApiConfigValue<EDhApiVerticalQuality> verticalQuality();
/** Modifies the quadratic function fake chunks use for horizontal quality drop-off. */
IDhApiConfigValue<EHorizontalQuality> horizontalQuality();
IDhApiConfigValue<EDhApiHorizontalQuality> horizontalQuality();
IDhApiConfigValue<ETransparency> transparency();
IDhApiConfigValue<EDhApiTransparency> transparency();
/** Defines what blocks won't be rendered as LODs. */
IDhApiConfigValue<EBlocksToAvoid> blocksToAvoid();
IDhApiConfigValue<EDhApiBlocksToAvoid> blocksToAvoid();
/**
* Defines if the color of avoided blocks will color the block below them. <Br>
@@ -112,17 +111,6 @@ public interface IDhApiGraphicsConfig extends IDhApiConfigGroup
// advanced graphic settings //
//===========================//
/**
* Sets the distance used by the near clip plane to reduce
* overdraw. <br>
* 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<EOverdrawPrevention> overdrawPrevention();
/**
* Sets the radius used by the near clip shader to reduce
* overdraw. <br>
@@ -172,7 +160,7 @@ public interface IDhApiGraphicsConfig extends IDhApiConfigGroup
*
* @since API 1.1.0
*/
IDhApiConfigValue<ELodShading> lodShading();
IDhApiConfigValue<EDhApiLodShading> lodShading();
/**
* Sets whether LODs outside the view frustum culling will
@@ -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<EHeightFogMixMode> heightFogMixMode();
IDhApiConfigValue<EDhApiHeightFogMixMode> heightFogMixMode();
/** Defines how the height fog is drawn relative to the camera or world. */
IDhApiConfigValue<EHeightFogMode> heightFogMode();
IDhApiConfigValue<EDhApiHeightFogMode> heightFogMode();
/**
* Defines the height fog's base height if {@link IDhApiHeightFogConfig#heightFogMode()}
@@ -64,7 +64,7 @@ public interface IDhApiHeightFogConfig extends IDhApiConfigGroup
IDhApiConfigValue<Double> heightFogMaxThickness();
/** Defines how the height fog changes in thickness. */
IDhApiConfigValue<EFogFalloff> heightFogFalloff();
IDhApiConfigValue<EDhApiFogFalloff> heightFogFalloff();
/** Defines the height fog's density. */
IDhApiConfigValue<Double> heightFogDensity();
@@ -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. <br>
* Note: Changing this while connected to a multiplayer world will cause undefined behavior!
*/
IDhApiConfigValue<EServerFolderNameMode> folderSavingMode();
IDhApiConfigValue<EDhApiServerFolderNameMode> folderSavingMode();
/**
* Defines the necessary similarity (as a percent) that two potential levels
@@ -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. <br>
* 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. <br>
*
* @author James Seibel
* @version 2023-1-23
* @version 2024-3-2
* @since API 1.1.0
*/
public abstract class DhApiScreenResizeEvent implements IDhApiEvent<DhApiScreenResizeEvent.EventParam>
public abstract class DhApiColorDepthTextureCreatedEvent implements IDhApiEvent<DhApiColorDepthTextureCreatedEvent.EventParam>
{
/** Fired immediately before Distant Horizons renders any transparent buffers. */
/** Fired before Distant Horizons creates. */
public abstract void onResize(DhApiEventParam<EventParam> event);
@@ -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;
@@ -33,7 +33,7 @@ public final class ModInfo
// region Protocol versions
// Incremented every time any packets are added, changed or removed, with a few exceptions.
/** Netty protocol version. */
public static final int PROTOCOL_VERSION = 2;
public static final int PROTOCOL_VERSION = 3;
/** Plugin channel protocol version. */
public static final int PLUGIN_PROTOCOL_VERSION = 1;
public static final String PLUGIN_CHANNEL_PATH = "plugin_channel";
@@ -45,7 +45,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.4-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");
@@ -59,4 +59,4 @@ public final class ModInfo
/** All DH owned threads should start with this string to allow for easier debugging and profiling. */
public static final String THREAD_NAME_PREFIX = "DH-";
}
}
@@ -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<ERendererMode, Boolean>
public class RenderModeEnabledConverter implements IConverter<EDhApiRendererMode, Boolean>
{
@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;
}
}
@@ -28,7 +28,7 @@ import org.junit.Test;
* @author James Seibel
* @version 2022-9-5
*/
public class ExampleTest
public class ExampleApiTest
{
@Test