Open LordMZTE opened 2 years ago
I'm not sure this feature is in scope of the project and even if it was it would have low priority. Maybe it could be implemented some time in the future if there's demand for it.
However if MultiMC can launch instances by path of some file instead of the instance id, you can try to set that up as a custom emulator and try Import emulated games
feature:
/path/to/multimc
--launch $file $game_args
(assuming --launch
can accept a file path)./mmc-pack.json|./instance.cfg
(or something inside of the instance dir that can be passed to multimc
)./minecraft/icon.png|./.minecraft/icon.png
Then click +
in the main window, open Import emulated games
dialog, set path to ~/.local/share/multimc/instances
and import.
Thanks! Unfortunately, MultiMC doesn't accept a file path as a launch argument, but that should be easy to fix with a simple shellscript. Thanks for explaining the custom emulators feature. Feel free to close this issue.
For anyone else who might be interested in doing this, I managed to get it work with these settings:
/home/username/.local/bin/gamehub_multimc
$file $game_args
./instance.cfg
./minecraft/icon.png|./.minecraft/icon.png
And using this script:
#!/bin/sh
inst_id=$(echo $1 | awk -F/ '{print $(NF-1)}')
multimc --launch "$inst_id" "${@:2}"
It would be amazing if GameHub would support importing minecraft instances from the MultiMC minecraft launcher.
This shouldn't be too hard to implement, as we could simply get the directories in the instances directory, which is set in the config file at
~/.local/share/multimc/multimc.cfg
.This file has an ini-like format, and contains this line if the user is using a custom location for storing instances:
Note that this path is relative too
~/.local/share/multimc
, and that the key is not present by default, in which case the launcher defaults to~/.local/share/multimc/instances
.Then, we could enumerate the contents of that directory. Each minecraft instance has its own directory, which contains these files:
minecraft
or.minecraft
: the actual data of the minecraft instance, shouldn't be important to GameHubicon.png
. GameHub should show this.mmc-pack.json
: contains some data of the components of the minecraft setup, including the minecraft version and things like modloaders if installed. Some of this information might be helpful if it was displayed in GameHub, but nothing all that important.instance.cfg
: an ini-style file which contains some important metadata, like the name of the instance. This will be important for GameHub.EDIT: an instance can be launched by invoking
multimc --launch <instance_id>
where the instance ID is the name of the instance's directory.