Skip to content

Incompatible with Cleanroom, causing crashes on startup. #11

Open

Description

@Hlwyefeng

The game crashes when using the Cleanroom loader, and applying the Fugue patch doesn't fix it. I've reached out to the Fugue author, but we couldn't resolve it. For details, please see the link below.
You can check this link.

CleanroomMC/Fugue#55
Mod list: OptiFine_1.12.2_HD_U_G5, AdvancedShader-1.0.2, Fugue-0.16.3.
Cleanroom-0.2.3-alpha、Java21

This is the latest.log before using the Fugue fix.
https://mclo.gs/T6ZPVTO

This is the latest.log after using the Fugue fix.
https://mclo.gs/taXsJhw

Activity

  1. Delfite commented on Apr 22, 2025

    @Delfite

    I don't know how to code, but I do know how to google stuff. I believe the code causing the crash seen in the second log file is this code found in src\main\java\advancedshader\core\Core.java:

    public class Core implements ITweaker {
    
        public static final File source;
    
        static {
            File file = null;
            try {
                URL url = Core.class.getProtectionDomain().getCodeSource().getLocation();
                URI uri = url.toURI();
    
                file = new File(uri);
            } catch (URISyntaxException e) {}
    
            source = file;
        }
    }
    

    Apparently, performing a URI here is bad because the file it's trying to read is inside another JAR file, and URIs are only meant to be performed on JAR files themselves or a different type of file, not whatever is contained within the file because the operating system only sees JAR files as a single file, not a folder that contains files.

    Someone on stack overflow recommended using getResourceAsStream(...); instead of whatever this code is trying to do. ChatGPT said something similar and spat out this code:

    import java.io.BufferedReader;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.nio.charset.StandardCharsets;
    
    public class Core implements ITweaker {
    
        public static final String sourceContent;
    
        static {
            String content = null;
            try (
                InputStream stream = Core.class.getResourceAsStream("/your_resource.txt");
                BufferedReader reader = new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8))
            ) {
                if (stream != null) {
                    StringBuilder sb = new StringBuilder();
                    String line;
                    while ((line = reader.readLine()) != null) {
                        sb.append(line).append(System.lineSeparator());
                    }
                    content = sb.toString();
                } else {
                    System.err.println("Resource not found!");
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
    
            sourceContent = content;
        }
    }
    

    Hopefully this helps someone fix this guy's issue because I'm nowhere near qualified for software development.

  2. floosher commented on Sep 11, 2026

    @floosher

    my fork https://github.com/floosher/AdvancedShader works with cleanroom. It is vibecoded so use it at your own risk!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions