CmlLib / CmlLib.Core

.NET Minecraft Launcher Library. All Version, Auth, Forge, Java, Crossplatform
MIT License
216 stars 42 forks source link

Disabled multiplayer in versions 1.16.4 and 1.16.5 #85

Closed WinnLov closed 1 year ago

WinnLov commented 1 year ago
As of snapshot 20w21a, two flags have been added, --disableChat and --disableMultiplayer. This allows multiplayer to work up to 1.16.3 and from 1.17 onwards, but in 1.16.4 and 1.16.5 multiplayer is disabled. 
The question of how to disable multiplayer simply by adding a flag to the startup arguments has already been raised, but I'm wondering if there is a way to disable or ignore the flag at startup so that multiplayer works on 1.16.4 and 1.16.5.
I've dug through a bunch of sources but haven't found a way to solve this problem, I realise that work on the project is now frozen, but maybe someone has been able to solve it or knows how to do it.
Thanks in advance :d
Tartilla-TAIGO commented 1 year ago

Hi. This is an authlib bug. It is observed only on these versions in offline mode. Many solved this problem by simply decompiling authlib and fixing this error.

Tartilla-TAIGO commented 1 year ago

You can change the authlib by path libraries\com\mojang\authlib\2.1.28 to this file before launching minecraft authlib-2.1.28-workaround.zip

WinnLov commented 1 year ago

Thanks, it looks like it really is an issue with authlib. Thanks again!

Tartilla-TAIGO commented 7 months ago

You may need to use authlib-injector using official Mojang servers. I have not tested with the official Mojang server, but with my own authentication server, the online game button is active. https://github.com/yushijinhun/authlib-injector

AlphaBs commented 2 months ago

easy solution: add extra JVM arguments

var process = await launcher.InstallAndBuildProcessAsync("1.16.5", new MLaunchOption
{
    Session = MSession.CreateOfflineSession("username"),
    ExtraJvmArguments = 
    [
        MArgument.FromCommandLine("-Dminecraft.api.env=custom -Dminecraft.api.auth.host=https://invalid.invalid -Dminecraft.api.account.host=https://invalid.invalid -Dminecraft.api.session.host=https://invalid.invalid -Dminecraft.api.services.host=https://invalid.invalid"),
    ]
});t