Ever wanted to keep playing during the half a minute that the "Photos" app takes to load the screenshot you just took? Or while you are waiting for your browser to open the link that the server sent in chat or in a book? Maybe you just your game to keep being responsive when you click the "Open resource packs folder"?
Well then this mod is for you!
FastOpenLinksAndFolders keeps your game responsive in those cases where it has to open something outside of the game, including opening screenshots from chat, links in chat or books, or the resource packs and data packs folders. It doesn't change or optimize anything else, it's just for those moments where you are opening something and the game would normally freeze. I considered them annoying and decided to make a mod to fix that.
How does it work?
When Minecraft asks the system to open one of those links, for some reason it decides to wait for the process to close the initial error reporter, blocking whatever is going on at the moment. While some programs in some systems may close the error stream quickly, it's usually not the case, and for example the "Photos" app from Windows can take a long while to close it, keeping the game frozen until it's ready. In my very old computer that sometimes took over a minute.
The reason the game does this is to be able to log an error in case the other app fails to load, which makes sense, but isn't ideal. Since the game doesn't actually care about those errors or the result of opening (other than printing it to the error log), FastOpenLinksAndFolders makes that waiting operation launch asynchronously, getting you the best of both worlds: Reporting errors if the other app fails to load and not blocking the game while that happens.
Updates?
Given that this mod is quite simple, it's unlikely that it'll require many updates. I'll try to keep marking working versions in the latest file after checking that it still works, but it's likely that it will Just Workâ„¢. If it doesn't, just raise an issue on Github if I haven't realized yet. For instance the first release works from 1.16 to 1.18, and just because I haven't tested any other version. Let me know if it works on another one!
Forge?
This is a really simple mod, I'm not sure how useful/worth it would it be given that I don't really use Forge. I first have to make sure Forge hasn't touched anything around there, but if there's (a tiny bit of) interest I will probably make it.