From d6bf29d5e8451ffc15edc38477502ee278af3a26 Mon Sep 17 00:00:00 2001 From: artdeell Date: Mon, 13 Jan 2025 23:16:01 +0300 Subject: [PATCH] Style[code]: code cosmetic changes --- .../main/java/net/kdt/pojavlaunch/Tools.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/Tools.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/Tools.java index 8d2e2cf944..ff0e57f2d3 100644 --- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/Tools.java +++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/Tools.java @@ -185,18 +185,17 @@ public static void initContextConstants(Context ctx){ } /** - * Optimization mods based on Soium can mitigate the render distance issue. Check if Sodium + * Optimization mods based on Sodium can mitigate the render distance issue. Check if Sodium * or its derivative is currently installed to skip the render distance check. - * @param gamedir current game directory + * @param gameDir current game directory * @return whether sodium or a sodium-based mod is installed */ - private static boolean hasSodium(File gamedir) { - File modsDir = new File(gamedir, "mods"); - File[] mods = modsDir.listFiles(); + private static boolean hasSodium(File gameDir) { + File modsDir = new File(gameDir, "mods"); + File[] mods = modsDir.listFiles(file -> file.isFile() && file.getName().endsWith(".jar")); if(mods == null) return false; for(File file : mods) { String name = file.getName(); - if(!file.isFile() && !name.endsWith(".jar")) continue; if(name.contains("sodium") || name.contains("embeddium") || name.contains("rubidium")) return true; @@ -206,8 +205,14 @@ private static boolean hasSodium(File gamedir) { /** * Initialize OpenGL and do checks to see if the GPU of the device is affected by the render - * distance issue. Currently only checks whether the user has an Adreno GPU capable of OpenGL ES 3 + * distance issue. + + * Currently only checks whether the user has an Adreno GPU capable of OpenGL ES 3 * and surfaceless rendering installed. + + * This issue is caused by a very severe limit on the amount of GL buffer names that could be allocated + * by the Adreno properietary GLES driver. + * @return whether the GPU is affected by the Large Thin Wrapper render distance issue on vanilla */ private static boolean affectedByRenderDistanceIssue() {