Fix render API vs Engine enum

This commit is contained in:
James Seibel
2026-05-20 07:27:30 -05:00
parent 9db045d614
commit faa4fa3782
11 changed files with 51 additions and 32 deletions
@@ -0,0 +1,17 @@
package com.seibel.distanthorizons.api.enums.config;
/**
* VULKAN, <br>
* OPEN_GL, <br>
*
* @see EDhApiRenderingEngine
*
* @since API 7.0.0
* @version 2026-3-10
*/
public enum EDhApiRenderingApi
{
VULKAN,
OPEN_GL;
}
@@ -1,16 +1,16 @@
package com.seibel.distanthorizons.api.enums.config; package com.seibel.distanthorizons.api.enums.config;
import com.seibel.distanthorizons.coreapi.ModInfo;
/** /**
* AUTO, <br> * AUTO, <br>
* OPEN_GL, <br> * OPEN_GL, <br>
* BLAZE_3D, <br><br> * BLAZE_3D, <br><br>
* *
* @since API 6.0.0 * @see EDhApiRenderingApi
*
* @since API 7.0.0
* @version 2026-3-10 * @version 2026-3-10
*/ */
public enum EDhApiRenderApi public enum EDhApiRenderingEngine
{ {
AUTO, AUTO,
OPEN_GL, OPEN_GL,
@@ -19,14 +19,14 @@
package com.seibel.distanthorizons.api.interfaces.override.rendering; package com.seibel.distanthorizons.api.interfaces.override.rendering;
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderApi; import com.seibel.distanthorizons.api.enums.config.EDhApiRenderingEngine;
import com.seibel.distanthorizons.api.interfaces.override.IDhApiOverrideable; import com.seibel.distanthorizons.api.interfaces.override.IDhApiOverrideable;
import com.seibel.distanthorizons.api.interfaces.render.IDhApiRenderProxy; import com.seibel.distanthorizons.api.interfaces.render.IDhApiRenderProxy;
/** /**
* <b>Note: </b><br> * <b>Note: </b><br>
* This is only used if Distant Horizons' * This is only used if Distant Horizons'
* {@link IDhApiRenderProxy#getRenderingApi()} returns {@link EDhApiRenderApi#OPEN_GL} * {@link IDhApiRenderProxy#getRenderingApi()} returns {@link EDhApiRenderingEngine#OPEN_GL}
* and {@link IDhApiRenderProxy#isNativeRenderer()} returns true. * and {@link IDhApiRenderProxy#isNativeRenderer()} returns true.
* ie this is only used when DH is doing native OpenGL rendering, * ie this is only used when DH is doing native OpenGL rendering,
* if DH is using Blaze3D this interface will be ignored. * if DH is using Blaze3D this interface will be ignored.
@@ -19,7 +19,7 @@
package com.seibel.distanthorizons.api.interfaces.override.rendering; package com.seibel.distanthorizons.api.interfaces.override.rendering;
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderApi; import com.seibel.distanthorizons.api.enums.config.EDhApiRenderingEngine;
import com.seibel.distanthorizons.api.interfaces.override.IDhApiOverrideable; import com.seibel.distanthorizons.api.interfaces.override.IDhApiOverrideable;
import com.seibel.distanthorizons.api.interfaces.render.IDhApiRenderProxy; import com.seibel.distanthorizons.api.interfaces.render.IDhApiRenderProxy;
import com.seibel.distanthorizons.api.interfaces.render.IDhApiRenderableBoxGroup; import com.seibel.distanthorizons.api.interfaces.render.IDhApiRenderableBoxGroup;
@@ -31,7 +31,7 @@ import com.seibel.distanthorizons.api.objects.render.DhApiRenderableBoxGroupShad
/** /**
* <b>Note: </b><br> * <b>Note: </b><br>
* This is only used if Distant Horizons' * This is only used if Distant Horizons'
* {@link IDhApiRenderProxy#getRenderingApi()} returns {@link EDhApiRenderApi#OPEN_GL} * {@link IDhApiRenderProxy#getRenderingApi()} returns {@link EDhApiRenderingEngine#OPEN_GL}
* and {@link IDhApiRenderProxy#isNativeRenderer()} returns true. * and {@link IDhApiRenderProxy#isNativeRenderer()} returns true.
* ie this is only used when DH is doing native OpenGL rendering, * ie this is only used when DH is doing native OpenGL rendering,
* if DH is using Blaze3D this interface will be ignored. * if DH is using Blaze3D this interface will be ignored.
@@ -19,7 +19,7 @@
package com.seibel.distanthorizons.api.interfaces.override.rendering; package com.seibel.distanthorizons.api.interfaces.override.rendering;
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderApi; import com.seibel.distanthorizons.api.enums.config.EDhApiRenderingEngine;
import com.seibel.distanthorizons.api.interfaces.override.IDhApiOverrideable; import com.seibel.distanthorizons.api.interfaces.override.IDhApiOverrideable;
import com.seibel.distanthorizons.api.interfaces.render.IDhApiRenderProxy; import com.seibel.distanthorizons.api.interfaces.render.IDhApiRenderProxy;
import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhApiRenderParam; import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhApiRenderParam;
@@ -28,7 +28,7 @@ import com.seibel.distanthorizons.api.objects.math.DhApiVec3f;
/** /**
* <b>Note: </b><br> * <b>Note: </b><br>
* This is only used if Distant Horizons' * This is only used if Distant Horizons'
* {@link IDhApiRenderProxy#getRenderingApi()} returns {@link EDhApiRenderApi#OPEN_GL} * {@link IDhApiRenderProxy#getRenderingApi()} returns {@link EDhApiRenderingEngine#OPEN_GL}
* and {@link IDhApiRenderProxy#isNativeRenderer()} returns true. * and {@link IDhApiRenderProxy#isNativeRenderer()} returns true.
* ie this is only used when DH is doing native OpenGL rendering, * ie this is only used when DH is doing native OpenGL rendering,
* if DH is using Blaze3D this interface will be ignored. * if DH is using Blaze3D this interface will be ignored.
@@ -19,7 +19,8 @@
package com.seibel.distanthorizons.api.interfaces.render; package com.seibel.distanthorizons.api.interfaces.render;
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderApi; import com.seibel.distanthorizons.api.enums.config.EDhApiRenderingApi;
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderingEngine;
import com.seibel.distanthorizons.api.methods.events.abstractEvents.DhApiAfterDhInitEvent; import com.seibel.distanthorizons.api.methods.events.abstractEvents.DhApiAfterDhInitEvent;
import com.seibel.distanthorizons.api.objects.DhApiResult; import com.seibel.distanthorizons.api.objects.DhApiResult;
@@ -47,9 +48,8 @@ public interface IDhApiRenderProxy
DhApiResult<Boolean> clearRenderDataCache(); DhApiResult<Boolean> clearRenderDataCache();
/** /**
* Returns which specific {@link EDhApiRenderApi} * Returns which specific {@link EDhApiRenderingApi}
* Distant Horizons will use for rendering. <br> * Distant Horizons will use for rendering. <br><br>
* Will not return {@link EDhApiRenderApi#AUTO}.<br>
* *
* @throws IllegalStateException if no renderer has been bound yet, * @throws IllegalStateException if no renderer has been bound yet,
* wait till after {@link DhApiAfterDhInitEvent} has been fired * wait till after {@link DhApiAfterDhInitEvent} has been fired
@@ -57,7 +57,7 @@ public interface IDhApiRenderProxy
* @see DhApiAfterDhInitEvent * @see DhApiAfterDhInitEvent
* @since API 7.0.0 * @since API 7.0.0
*/ */
EDhApiRenderApi getRenderingApi() throws IllegalStateException; EDhApiRenderingApi getRenderingApi() throws IllegalStateException;
/** /**
* Returns true if the current renderer * Returns true if the current renderer
* is calling the base rendering API's method calls. <br> * is calling the base rendering API's method calls. <br>
@@ -812,15 +812,15 @@ public class Config
.addListener(IgnoredDimensionCsvHandler.INSTANCE) .addListener(IgnoredDimensionCsvHandler.INSTANCE)
.build(); .build();
public static ConfigEntry<EDhApiRenderApi> renderingApi = new ConfigEntry.Builder<EDhApiRenderApi>() public static ConfigEntry<EDhApiRenderingEngine> renderingEngine = new ConfigEntry.Builder<EDhApiRenderingEngine>()
.set(EDhApiRenderApi.AUTO) .set(EDhApiRenderingEngine.AUTO)
.comment("" .comment(""
+ "Requires a restart to change. \n" + "Requires a restart to change. \n"
+ " \n" + " \n"
+ "Options: \n" + "Options: \n"
+ EDhApiRenderApi.AUTO + " - changes based on the most likely API for that MC version \n" + EDhApiRenderingEngine.AUTO + " - changes based on the most likely API for that MC version \n"
+ EDhApiRenderApi.OPEN_GL + " - Default \n" + EDhApiRenderingEngine.OPEN_GL + " - Default \n"
+ EDhApiRenderApi.BLAZE_3D + " - Only supported on MC 1.21.11 \n" + EDhApiRenderingEngine.BLAZE_3D + " - Only supported on MC 1.21.11 \n"
+ "") + "")
.build(); .build();
@@ -1438,8 +1438,9 @@ public class Config
public static ConfigEntry<EDhApiDataCompressionMode> dataCompression = new ConfigEntry.Builder<EDhApiDataCompressionMode>() public static ConfigEntry<EDhApiDataCompressionMode> dataCompression = new ConfigEntry.Builder<EDhApiDataCompressionMode>()
.set(EDhApiDataCompressionMode.Z_STD_BLOCK) .set(EDhApiDataCompressionMode.Z_STD_BLOCK)
// only visible via the API since there is no reason to use any compressor except ZStandard as of 2025-11-24 // only visible via the file since there is no reason to use any compressor except ZStandard as of 2025-11-24
.setAppearance(EConfigEntryAppearance.ONLY_IN_API) // the only reason this hasn't been fully removed is due to some people having issues specifically with ZSTD
.setAppearance(EConfigEntryAppearance.ONLY_IN_FILE)
.build(); .build();
public static ConfigEntry<EDhApiWorldCompressionMode> worldCompression = new ConfigEntry.Builder<EDhApiWorldCompressionMode>() public static ConfigEntry<EDhApiWorldCompressionMode> worldCompression = new ConfigEntry.Builder<EDhApiWorldCompressionMode>()
@@ -19,7 +19,8 @@
package com.seibel.distanthorizons.core.render; package com.seibel.distanthorizons.core.render;
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderApi; import com.seibel.distanthorizons.api.enums.config.EDhApiRenderingApi;
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderingEngine;
import com.seibel.distanthorizons.api.interfaces.render.IDhApiRenderProxy; import com.seibel.distanthorizons.api.interfaces.render.IDhApiRenderProxy;
import com.seibel.distanthorizons.api.objects.DhApiResult; import com.seibel.distanthorizons.api.objects.DhApiResult;
import com.seibel.distanthorizons.core.api.internal.SharedApi; import com.seibel.distanthorizons.core.api.internal.SharedApi;
@@ -97,7 +98,7 @@ public class DhApiRenderProxy implements IDhApiRenderProxy
} }
@Override @Override
public EDhApiRenderApi getRenderingApi() throws IllegalStateException public EDhApiRenderingApi getRenderingApi() throws IllegalStateException
{ {
AbstractDhRenderApiDefinition apiDef = tryGetApiDef(); AbstractDhRenderApiDefinition apiDef = tryGetApiDef();
if (apiDef == null) if (apiDef == null)
@@ -19,7 +19,7 @@
package com.seibel.distanthorizons.core.wrapperInterfaces; package com.seibel.distanthorizons.core.wrapperInterfaces;
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderApi; import com.seibel.distanthorizons.api.enums.config.EDhApiRenderingEngine;
import com.seibel.distanthorizons.coreapi.interfaces.dependencyInjection.IBindable; import com.seibel.distanthorizons.coreapi.interfaces.dependencyInjection.IBindable;
/** /**
@@ -34,6 +34,6 @@ public interface IVersionConstants extends IBindable
{ {
String getMinecraftVersion(); String getMinecraftVersion();
EDhApiRenderApi getDefaultRenderingApi(); EDhApiRenderingEngine getDefaultRenderingEngine();
} }
@@ -21,9 +21,9 @@ package com.seibel.distanthorizons.core.wrapperInterfaces.minecraft;
import java.awt.Color; import java.awt.Color;
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderApi;
import com.seibel.distanthorizons.core.api.internal.rendering.DhRenderState; import com.seibel.distanthorizons.core.api.internal.rendering.DhRenderState;
import com.seibel.distanthorizons.core.enums.EDhDirection; import com.seibel.distanthorizons.core.enums.EDhDirection;
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderingApi;
import com.seibel.distanthorizons.core.wrapperInterfaces.misc.ILightMapWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.misc.ILightMapWrapper;
import com.seibel.distanthorizons.coreapi.interfaces.dependencyInjection.IBindable; import com.seibel.distanthorizons.coreapi.interfaces.dependencyInjection.IBindable;
import com.seibel.distanthorizons.core.util.math.Vec3d; import com.seibel.distanthorizons.core.util.math.Vec3d;
@@ -76,8 +76,8 @@ public interface IMinecraftRenderWrapper extends IBindable
boolean mcRendersToFrameBuffer(); boolean mcRendersToFrameBuffer();
boolean runningLegacyOpenGL(); boolean runningLegacyOpenGL();
/** Returns the API Minecraft is currently using for rendering */ /** Returns the Graphics API Minecraft is currently using for rendering */
EDhApiRenderApi getMcRenderingApi(); EDhApiRenderingApi getMcRenderingApi();
/** @return -1 if no valid framebuffer is available yet */ /** @return -1 if no valid framebuffer is available yet */
int getTargetFramebuffer(); // Note: Iris is now hooking onto this for DH + Iris compat, try not to change (unless we wanna deal with some annoyances) int getTargetFramebuffer(); // Note: Iris is now hooking onto this for DH + Iris compat, try not to change (unless we wanna deal with some annoyances)
@@ -1,6 +1,7 @@
package com.seibel.distanthorizons.core.wrapperInterfaces.render; package com.seibel.distanthorizons.core.wrapperInterfaces.render;
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderApi; import com.seibel.distanthorizons.api.enums.config.EDhApiRenderingApi;
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderingEngine;
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector; import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
import com.seibel.distanthorizons.core.jar.EPlatform; import com.seibel.distanthorizons.core.jar.EPlatform;
import com.seibel.distanthorizons.core.render.EDhRenderDepth; import com.seibel.distanthorizons.core.render.EDhRenderDepth;
@@ -32,8 +33,7 @@ public abstract class AbstractDhRenderApiDefinition implements IBindable
public boolean useSingleIbo() { return this.useSingleIbo; } public boolean useSingleIbo() { return this.useSingleIbo; }
public abstract EDhRenderDepth getRenderDepth(); public abstract EDhRenderDepth getRenderDepth();
/** will not return {@link EDhApiRenderApi#AUTO} */ public abstract EDhApiRenderingApi getRenderApi();
public abstract EDhApiRenderApi getRenderApi();
/** /**
* Returns true if the current renderer * Returns true if the current renderer
* is calling the base rendering API's method calls. <br> * is calling the base rendering API's method calls. <br>