diff --git a/common/src/workarounds/java/net/caffeinemc/mods/sodium/client/compatibility/checks/BugChecks.java b/common/src/workarounds/java/net/caffeinemc/mods/sodium/client/compatibility/checks/BugChecks.java index c4ef0b2a3e..3a31a03816 100644 --- a/common/src/workarounds/java/net/caffeinemc/mods/sodium/client/compatibility/checks/BugChecks.java +++ b/common/src/workarounds/java/net/caffeinemc/mods/sodium/client/compatibility/checks/BugChecks.java @@ -10,6 +10,7 @@ class BugChecks { public static final boolean ISSUE_2048 = configureCheck("issue2048", true); public static final boolean ISSUE_2561 = configureCheck("issue2561", true); public static final boolean ISSUE_2637 = configureCheck("issue2637", true); + public static final boolean ISSUE_2862 = configureCheck("issue2862", true); private static boolean configureCheck(String name, boolean defaultValue) { var propertyValue = System.getProperty(getPropertyKey(name), null); diff --git a/common/src/workarounds/java/net/caffeinemc/mods/sodium/client/compatibility/checks/ModuleScanner.java b/common/src/workarounds/java/net/caffeinemc/mods/sodium/client/compatibility/checks/ModuleScanner.java index 8107366ef7..da4db2e95c 100644 --- a/common/src/workarounds/java/net/caffeinemc/mods/sodium/client/compatibility/checks/ModuleScanner.java +++ b/common/src/workarounds/java/net/caffeinemc/mods/sodium/client/compatibility/checks/ModuleScanner.java @@ -36,6 +36,10 @@ public class ModuleScanner { "GTIII-OSD64.dll", "GTIII-OSD.dll" }; + private static final String[] OVERWOLF_OVERLAY_MODULE_NAMES = { + "gep_minecraft.dll" + }; + public static void checkModules(NativeWindowHandle window) { List modules; @@ -63,6 +67,13 @@ public static void checkModules(NativeWindowHandle window) { if (BugChecks.ISSUE_2637 && isModuleLoaded(modules, ASUS_GPU_TWEAK_MODULE_NAMES)) { checkASUSGpuTweakIII(window); } + + // OverWolf's overlay is broken and modifies the texture bindings from underneath Minecraft. Since disabling + // OpenGL state caching in Minecraft for every texture bind is unacceptable, and OverWolf does not provide + // any way to detect broken versions of their software, we block all versions. + if (BugChecks.ISSUE_2862 & isModuleLoaded(modules, OVERWOLF_OVERLAY_MODULE_NAMES)) { + checkOverwolfOverlay(window); + } } private static List listModules() { @@ -139,6 +150,19 @@ private static void checkASUSGpuTweakIII(NativeWindowHandle window) { "see here for more details: https://github.com/CaffeineMC/sodium/wiki/Known-Issues#asus-gtiii-incompatible"); } + private static void checkOverwolfOverlay(NativeWindowHandle window) { + MessageBox.showMessageBox(window, MessageBox.IconType.ERROR, "Sodium Renderer", + """ + The Overwolf Overlay is not compatible with Minecraft and causes graphical corruption. Please disable the in-game overlay in the Overwolf application, or uninstall the software from your computer. + + For more information on how to solve this problem, click the 'Help' button.""", + "https://github.com/CaffeineMC/sodium/wiki/Known-Issues#overwolf-overlay"); + + throw new RuntimeException("Overwolf Overlay is not compatible with Minecraft, " + + "see here for more details: https://github.com/CaffeineMC/sodium/wiki/Known-Issues#overwolf-overlay"); + + } + private static @Nullable WindowsFileVersion findRTSSModuleVersion() { long module;