Skip to content

Commit

Permalink
Merge #1069 (ProfileKeys error message fix) into v7.46.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Oct 7, 2024
2 parents 9a354e3 + 44fe425 commit 14e7af5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public static void login(String email, String password)

Session session = new Session(mcProfile.getName(), mcProfile.getUUID(),
mcProfile.getAccessToken(), Optional.empty(), Optional.empty(),
Session.AccountType.MOJANG);
Session.AccountType.MSA);

WurstClient.IMC.setSession(session);
}
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/net/wurstclient/mixin/MinecraftClientMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
package net.wurstclient.mixin;

import java.io.File;
import java.util.UUID;

import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -27,7 +26,6 @@
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.network.ClientPlayerInteractionManager;
import net.minecraft.client.session.ProfileKeys;
import net.minecraft.client.session.ProfileKeysImpl;
import net.minecraft.client.session.Session;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;
Expand Down Expand Up @@ -59,7 +57,7 @@ public abstract class MinecraftClientMixin
private YggdrasilAuthenticationService authenticationService;

private Session wurstSession;
private ProfileKeysImpl wurstProfileKeys;
private ProfileKeys wurstProfileKeys;

private MinecraftClientMixin(WurstClient wurst, String name)
{
Expand Down Expand Up @@ -213,10 +211,12 @@ public void setSession(Session session)
{
wurstSession = session;

UserApiService userApiService = authenticationService
.createUserApiService(session.getAccessToken());
UUID uuid = wurstSession.getUuidOrNull();
UserApiService userApiService =
session.getAccountType() == Session.AccountType.MSA
? authenticationService.createUserApiService(
session.getAccessToken())
: UserApiService.OFFLINE;
wurstProfileKeys =
new ProfileKeysImpl(userApiService, uuid, runDirectory.toPath());
ProfileKeys.create(userApiService, session, runDirectory.toPath());
}
}

0 comments on commit 14e7af5

Please sign in to comment.