remove Iris incompatibility and disable validation when present

This commit is contained in:
James Seibel
2026-04-11 15:23:32 -05:00
parent cd67a773c5
commit b42d3d8f74
3 changed files with 31 additions and 6 deletions
@@ -1,5 +1,7 @@
package com.seibel.distanthorizons.fabric.mixins.client;
import com.seibel.distanthorizons.core.logging.DhLogger;
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
import com.seibel.distanthorizons.coreapi.ModInfo;
import net.minecraft.SharedConstants;
import org.spongepowered.asm.mixin.*;
@@ -16,8 +18,34 @@ public abstract class MixinSharedConstants
@Inject(method = "<clinit>", at = @At("TAIL"))
private static void setIsRunningInIde(CallbackInfo ci)
{
// run extra validation for dev builds
DhLogger logger = new DhLoggerBuilder().name("SharedConstants").build();
// setting IS_RUNNING_IN_IDE to true enables
// additional validation on Mojang's side which
// helps catch errors when developing for Blaze3D
boolean irisPresent;
#if MC_VER <= MC_1_21_11
IS_RUNNING_IN_IDE = ModInfo.IS_DEV_BUILD;
#else
try
{
// Iris has a bug for MC 26 and newer where it doesn't have
// a "sampler1" bound, causing a renderer crash if
// Blaze3D validation is enabled (which is enabled by if
// IS_RUNNING_IN_IDE is true)
ModInfo.class.getClassLoader().loadClass("net.irisshaders.iris.api.v0.IrisApi");
irisPresent = true;
}
catch (ClassNotFoundException ignore)
{
irisPresent = false;
}
IS_RUNNING_IN_IDE = ModInfo.IS_DEV_BUILD && !irisPresent;
#endif
logger.info("Setting Minecraft's SharedConstants.IS_RUNNING_IN_IDE to ["+IS_RUNNING_IN_IDE+"]");
}
}
+1 -4
View File
@@ -26,10 +26,7 @@ bclib_version=
immersive_portals_version=
canvas_version=
# There is a bug on Iris' end where it fails to rebind "sampler1"
# causing a Blaze3D validation to fail, crashing the renderer.
# Unfortunately this bug doesn't appear to be fixable on DH's end.
fabric_incompatibility_list={ "iris": "*" }
fabric_incompatibility_list={ }
fabric_recommend_list={}
# Fabric mod run