Auto-change rendering backend when Iris is present

This commit is contained in:
s809
2026-04-19 12:57:23 +05:00
parent a206e49b2b
commit d750e489df
@@ -376,14 +376,11 @@ public abstract class AbstractModInitializer
// Iris only supports native OpenGL // Iris only supports native OpenGL
if (renderApi != EDhApiRenderApi.OPEN_GL) if (renderApi != EDhApiRenderApi.OPEN_GL)
{ {
String irisUnsupportedMessage = "Iris doesn't support DH when using the ["+EDhApiRenderApi.BLAZE_3D+"] rendering API, this will need to be fixed on Iris end. As a temporary fix please change the rendering API to ["+EDhApiRenderApi.OPEN_GL+"] in the DH config file."; String irisUnsupportedMessage = "Iris does not support DH when using the [" + EDhApiRenderApi.BLAZE_3D + "] rendering API, this will need to be fixed on Iris end.\nRendering API will be auto-changed to [" + EDhApiRenderApi.OPEN_GL + "].";
LOGGER.fatal(irisUnsupportedMessage); LOGGER.error(irisUnsupportedMessage);
NativeDialogUtil.showDialog(ModInfo.READABLE_NAME, irisUnsupportedMessage, "ok", "error"); NativeDialogUtil.showDialog(ModInfo.READABLE_NAME, irisUnsupportedMessage, "ok", "warning");
IMinecraftClientWrapper mc = SingletonInjector.INSTANCE.get(IMinecraftClientWrapper.class); Config.Client.Advanced.Graphics.Experimental.renderingApi.set(EDhApiRenderApi.OPEN_GL);
String errorMessage = "loading Distant Horizons. "+irisUnsupportedMessage;
String exceptionError = "Distant Horizons conditional mod config Exception";
mc.crashMinecraft(errorMessage, new Exception(exceptionError));
} }
} }