This is a custom launcher for a modded minecraft server i used to play on with some friends
Almost the entirety of the code is from the project Javafx-launcher available here : https://github.com/Support-Launcher/javafx-launcher
I also highly recommend the youtube serie from Bricklou which explains the code : https://www.youtube.com/playlist?list=PL4Iry42iWxQQo-xMzk2BRO1YOoHgG-slU
It also heavily relies on FlowUpdater : https://github.com/FlowArg/FlowUpdater
Big Shout-out to Bricklou and FlowArg for their work which helped me to have some fun with my friends on our minecraft server 🙌
Here are my modifications from the source code :
- New design
- Removed the Mojang Connection since it's deprecated
- Changed Game and Forge Version to 1.20.1
- Added possibility to download the curse forge mods list from a FTP server (not secure tho, require to put the credentials in the code but it's fine if you don't plan to distribute the launcher publicly)
- Also download custom mods that aren't on Forge (must be added as arguments in the ModFileDeleter!)
- Added DownloadMod in the utils section which download : Curse Forge Mods List, version.txt, and custom mods
- Possibility to update the launcher if version in version.txt > current version of the user's launcher
- DownloadUpdate is called if the user want to download newer version and a cmd script in Main Class will replace the launcher by the newer version once downloaded
I use my Django WebApp hosted on PythonAnywhere to store the files and download them. The code is available here : https://github.com/NicolasDortu/Django-Minecraft-Server-WebApp
To create the .exe I use Launch4J and in order to distribute the file to friend i create an installer with the .exe file and a Java JDK using Inno. You can follow these tutorials which are very explicatives :
- Jar to Exe : https://www.youtube.com/watch?v=51iMSVUOQNM
- Bundle an Exe and a JRE/JDK : https://www.youtube.com/watch?v=k6m2a1OtfZ4