mindstorm38 / portablemc

A fast, reliable and cross-platform command-line Minecraft launcher and API for developers. Including fast and easy installation of common mod loaders such as Fabric, Forge, NeoForge and Quilt.
https://pypi.org/project/portablemc/
GNU General Public License v3.0
369 stars 20 forks source link

Support for Optifine #20

Open jugendhausldbg opened 3 years ago

jugendhausldbg commented 3 years ago

Hi there, is it possible to add support for Optifine, or is there already a way to enable Optifine? thanks for your amazing work

mindstorm38 commented 3 years ago

Hello! Thank you for supporting this project!

Optifine is not currently supported through any addon, however this is a great idea of add-on.

GoodDay360 commented 3 years ago

@jugendhausldbg You can install Optifine with Fabric.

mindstorm38 commented 3 years ago

Yes, optifine with fabric is a good idea. If you really want optifine only you can use the optifine installer and then use the version name (something like 1.16.2-OptiFine_HD_U_G3) to start the version with start 1.16.2-OptiFine_HD_U_G3. This should work.

mindstorm38 commented 3 years ago

I contacted sp614x (OptiFine's author) to ask him for permission to make an addon like this.

He's ok if and only if OptiFine is not bundled nor distributed with PortableMC's package. Hopefully, he seems ok with the idea of an add-on that will download the mod from the website.

This message is just a note for the future, the add-on is not in development for now.

GoodDay360 commented 2 years ago

Btw If you need a way to download Optifine and list all of Optifine versions. I could provide you with the API.

mindstorm38 commented 2 years ago

Yes why not it would be cool because my current idea is to parse the web page, which is not really easy and lightweight.

GoodDay360 commented 2 years ago

@mindstorm38 Check https://github.com/GoodDay360/Optifine-API.

mindstorm38 commented 2 years ago

Who is maintaining the API?

GoodDay360 commented 2 years ago

@mindstorm38 https://rapidapi.com/user/nitroxenon. The website is broken I used backdoor requests to subscribe to the API.

WoMspace commented 2 years ago

hello! I'm a shader developer, and a moderater over on the shaderLABS discord. Downloading Optifine programatically from the website is perfectly fine, and sp614x will have no issues with that.

As for an API, major releases are few and far between, so hosting and maintaining a list of URLs somewhere online would be trivial. just curl <someurl>/optifine_links | grep <version> or something when an install is requested. You might want to take a look at vivecraft, and more specifically install.py and minecriftversion.py. Alternatively, would it be so hard to ask users to download it and just provide the jar file?

Regardless, if you would like any assistance regarding optifine (including downloading) head over to the shaderLABS discord server

mindstorm38 commented 2 years ago

Thank you for support! I'll definitely look into it in the future

GoodDay360 commented 2 years ago

@WoMspace It is not that hard to ask the user to install it manually. But the way of doing it automatically is better.

GoodDay360 commented 1 year ago

I wonder if PMC supports optifine yet, because it seems like this request is still open. Anyway long ago I provided the api for getting optifine but it is not well maintained. However a few days ago I managed to web scrape the optifine site and get all version info. Sauce: https://github.com/GoodDay360/OptiPy

Optifine author seems to be fine about it and he also gives me a direct mirror link for downloading the file.

mindstorm38 commented 1 year ago

Optifine is not yet supported, and I still wonder if this is a good idea, mainly because Optifine in itself can be installed really quickly as a forge mod, and forge can be installed really easily now... This is not definitive, and I'm still opened to arguments, because I'm afraid it will require some hard work.

GoodDay360 commented 1 year ago

Optifine is not yet supported, and I still wonder if this is a good idea, mainly because Optifine in itself can be installed really quickly as a forge mod, and forge can be installed really easily now... This is not definitive, and I'm still opened to arguments, because I'm afraid it will require some hard work.

It doesn't require much work to implement this. Just download and write optifine into the user mod folder if they run it with forge especially the version that fabric doesn't support. This saves so much time in some cases instead of opening the browser every time u want optifine on a different version. Caches downloaded optifine if possible if the user doesn't have internet, this may help in case users don't save their own. (Caches doesn't mean bundle the file so it is probably safe to do it).

More than that you can also make an optifine standalone installation too if u have some free time. Launch optifine directly without forge. This gonna take a while to wrap everything.

mindstorm38 commented 1 year ago

For now, I'll stay away from the mess of managing the "mods" directory, because this would require checking for already installed version, disabling old one, all of this is not trivial at all because mods are not uniquely defined by the file name.

So it seems way more realistic to me to support standalone installation, even if this is still complicated in itself.