The-Fireplace-Minecraft-Mods / In-Game-Account-Switcher

This mod allows you to change your logged in account in-game, without restarting Minecraft.
https://modrinth.com/mod/in-game-account-switcher
GNU Lesser General Public License v3.0
88 stars 36 forks source link

In version 1.8.9 forge #168

Closed gunanjieshuo closed 2 months ago

gunanjieshuo commented 2 months ago

In the AccountListScreen. java file, in the login and loginOffline methods private void login() { if (list.selectedElement() < 0 || state != null) return; Account acc = list.entries.get(list.selectedElement()).account(); updateButtons(); state = ""; acc.login((s, o) -> state = I18n.format(s, o)).whenComplete((d, t) -> { state = null; if (t != null) { mc.addScheduledTask(() -> mc.displayGuiScreen(new IASAlertScreen(() -> mc.displayGuiScreen(this), EnumChatFormatting.RED + I18n.format("ias.error"), String.valueOf(t)))); return; } mc.addScheduledTask(() -> { mc.session = new Session(d.name(), UUIDTypeAdapter.fromUUID(d.uuid()), d.accessToken(), d.userType()); }); }); }

private void loginOffline() {
    if (list.selectedElement() < 0 || state != null) return;
    Account acc = list.entries.get(list.selectedElement()).account();
    mc.session = new Session(acc.name(), UUIDTypeAdapter.fromUUID(UUID
            .nameUUIDFromBytes("OfflinePlayer".concat(acc.name()).getBytes(StandardCharsets.UTF_8))),
            "0", "legacy");
}

Two of the sessions reported errors The error message is: 'session' has private access in 'net', minecraft.client,Minecraft May I ask how to solve this Thanks

VidTu commented 2 months ago

1.8.9 is not supported and probably will never be.