Skip to content

Added option expose valid game arguments#48

Open
Im-making-tools wants to merge 1 commit into
sammko:masterfrom
Im-making-tools:features
Open

Added option expose valid game arguments#48
Im-making-tools wants to merge 1 commit into
sammko:masterfrom
Im-making-tools:features

Conversation

@Im-making-tools

Copy link
Copy Markdown

This allows to add enable rules and features to launcher arguments e.g. for v1.20.1. This enables to set quick play options, below example starts game connecting to localhost server:

from contextlib import ExitStack

from picomc.account import OfflineAccount, AccountManager
from picomc.instance import InstanceManager
from picomc.launcher import Launcher

PACK_NAME = 'test_1'
USERNAME = 'player'
VERSION = '1.20.1'

if __name__ == '__main__':
    with ExitStack() as es:
        launcher = Launcher(es)
        acc = OfflineAccount.new(AccountManager(launcher), USERNAME)
        im = InstanceManager(launcher)
        inst = im.create(PACK_NAME, VERSION)
        inst.features = {
            'is_quick_play_singleplayer': False,
            'is_quick_play_multiplayer': True,
        }
        inst.features_args = {
            'quickPlaySingleplayer': '',
            'quickPlayMultiplayer': '127.0.0.1:25565',
        }
        inst.launch(acc)

This would need minimal modifications to include in cli, as mentioned in #31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant