在陶瓦联机界面启动游戏时禁用离线皮肤功能 (#4916)

This commit is contained in:
Glavo
2025-12-18 21:18:03 +08:00
committed by GitHub
parent 25c9ef0f27
commit 567bd15997
5 changed files with 32 additions and 10 deletions

View File

@@ -103,10 +103,14 @@ public class OfflineAccount extends Account {
return skin != null && skin.getType() != Skin.Type.DEFAULT;
}
public AuthInfo logInWithoutSkin() throws AuthenticationException {
// Using "legacy" user type here because "mojang" user type may cause "invalid session token" or "disconnected" when connecting to a game server.
return new AuthInfo(username, uuid, UUIDTypeAdapter.fromUUID(UUID.randomUUID()), AuthInfo.USER_TYPE_MSA, "{}");
}
@Override
public AuthInfo logIn() throws AuthenticationException {
// Using "legacy" user type here because "mojang" user type may cause "invalid session token" or "disconnected" when connecting to a game server.
AuthInfo authInfo = new AuthInfo(username, uuid, UUIDTypeAdapter.fromUUID(UUID.randomUUID()), AuthInfo.USER_TYPE_MSA, "{}");
AuthInfo authInfo = logInWithoutSkin();
if (loadAuthlibInjector(skin)) {
CompletableFuture<AuthlibInjectorArtifactInfo> artifactTask = CompletableFuture.supplyAsync(() -> {