ServerSync

ServerSync

48.5k Downloads

AutoSync on the official launcher

Matthysse opened this issue ยท 6 comments

commented

Hello!
I saw it was possible to make an autosync of the mods to a client from a server with MultiMC each time the client starts Minecraft. But there are a lot of people who don't know how all this work and don't want to have an additionnal launcher or to go to AppData to drop the jar. Isn't it possible to make an auto-sync in the official launcher?
I remember this forge-like installer which installed all mods and updated them every time we wanted to start the profile using the official launcher (sorry if it's in french, but the way it worked was really convenient and perfect for new players). As admins we could be able to set a profile name and icon etc.. in the official launcher that would be created using a jar that they download.
https://www.minecraftforgefrance.fr/topic/2587/cr%C3%A9ez-votre-propre-installateur
This works by using a hosted server, but why couldn't it work with a standard minecraft server?

commented

I wonder if you could set a serversync.bat file up as the Java executable, that would run the sync process first, then just start up the game.

commented

I am a total noob regarding this, but I have been trying that bat file route for a while, and it seems Mojang did a great job at security here. It seems the way it works is that based on the lastVersionId it will download/use the patched jar from a trusted source and then run that automatically.

So we cannot alter the script itself, but we could pass some Java arguments to do some funky things, but that would require the sync to be a mod, run on its own, and prompt the users to restart the client if there were changes made.

EDIT: I suppose it would be possible to create a simple mod that adds a button on the server list, or the main menu, which then could launch the sync and potentially close Minecraft if needed.

commented

I don't think the official launcher allows you to hook startup events, however, I have not really looked into what the launcher can do for several years.

commented

It is possible, and it works really great! I linked you a program that the french forge community made that is a modified version of the forge installer. Then this personalized installer (customized by the owner of the modpack/server) creates a new profile in the official minecraft launcher, and every time you start the profile, it syncs to a host (in this case it's not the server, but a different host), you could use this way to sync using the server, so the server owners wouldn't have to buy a separate host!

It worked until 1.13 and the autor don't have time anymore to update it with the new forge versions. It was a very conveniant way to give people that aren't pros a modpack that would be automatically updated, because not everyone can go in %appdata% and place a jar and going there every time they want to sync.

commented

Looks promising, its a shame that the above tutorial does not appear to have a link to any source code so there is not really much to learn from it other than its probably possible to add startup hooks with the official launcher.

This will still have to be a backlog task of looking into how to work with the official launcher.

commented

They have the source code on a github, don't know if it can help: https://github.com/FFMT/ModPackInstaller