From d60789bf8b8428e96536cff3fd20f1603d4e80cb Mon Sep 17 00:00:00 2001 From: BianXiao <137746769+mcbianxiao@users.noreply.github.com> Date: Tue, 17 Sep 2024 23:18:50 +0800 Subject: [PATCH] Delete src/main/java/me/jellysquid/mods/sodium/client/compatibility/checks/PostLaunchChecks.java --- .../checks/PostLaunchChecks.java | 76 ------------------- 1 file changed, 76 deletions(-) delete mode 100644 src/main/java/me/jellysquid/mods/sodium/client/compatibility/checks/PostLaunchChecks.java diff --git a/src/main/java/me/jellysquid/mods/sodium/client/compatibility/checks/PostLaunchChecks.java b/src/main/java/me/jellysquid/mods/sodium/client/compatibility/checks/PostLaunchChecks.java deleted file mode 100644 index 4615e65680..0000000000 --- a/src/main/java/me/jellysquid/mods/sodium/client/compatibility/checks/PostLaunchChecks.java +++ /dev/null @@ -1,76 +0,0 @@ -package me.jellysquid.mods.sodium.client.compatibility.checks; - -import me.jellysquid.mods.sodium.client.SodiumClientMod; -import me.jellysquid.mods.sodium.client.gui.console.Console; -import me.jellysquid.mods.sodium.client.gui.console.message.MessageLevel; -import net.minecraft.client.font.MultilineText; -import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.gui.screen.ScreenTexts; -import net.minecraft.client.gui.widget.ButtonWidget; -import net.minecraft.client.gui.widget.CheckboxWidget; -import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.text.LiteralText; -import net.minecraft.text.Text; -import net.minecraft.text.TranslatableText; -import net.minecraft.util.Formatting; -import net.minecraft.util.Util; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import net.fabricmc.api.ClientModInitializer; -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; -import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback; -import net.fabricmc.loader.api.FabricLoader; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Performs OpenGL driver validation after the game creates an OpenGL context. This runs immediately after OpenGL - * context creation, and uses the implementation details of the OpenGL context to perform validation. - */ -public class PostLaunchChecks { - private static final Logger LOGGER = LoggerFactory.getLogger("Sodium-PostlaunchChecks"); - - public static void onContextInitialized() { - // FIXME: This can be determined earlier, but we can't access the GUI classes in pre-launch - if (isUsingPojavLauncher()) { - Console.instance().logMessage(MessageLevel.WARN, Text.translatable("sodium.console.pojav_launcher"), 30.0); - LOGGER.info("modified version of Sodium is running on PojavLauncher, if you run into any problems please report the problem to BianXiao and not to the Sodium team"); - } - } - - // https://github.com/CaffeineMC/sodium-fabric/issues/1916 - private static boolean isUsingPojavLauncher() { - if (System.getenv("POJAV_RENDERER") != null) { - LOGGER.warn("Detected presence of environment variable POJAV_LAUNCHER, which seems to indicate we are running on Android"); - - return true; - } - - var librarySearchPaths = System.getProperty("java.library.path", null); - - if (librarySearchPaths != null) { - for (var path : librarySearchPaths.split(":")) { - if (isKnownAndroidPathFragment(path)) { - LOGGER.warn("Found a library search path which seems to be hosted in an Android filesystem: {}", path); - - return true; - } - } - } - - var workingDirectory = System.getProperty("user.home", null); - - if (workingDirectory != null) { - if (isKnownAndroidPathFragment(workingDirectory)) { - LOGGER.warn("Working directory seems to be hosted in an Android filesystem: {}", workingDirectory); - } - } - - return false; - } - - private static boolean isKnownAndroidPathFragment(String path) { - return path.matches("/data/user/[0-9]+/net\\.kdt\\.pojavlaunch"); - } -}