Skip to content

Commit

Permalink
Remove account mixins (meteor added them), Fix account not working in…
Browse files Browse the repository at this point in the history
… prod env. (#232)
  • Loading branch information
hexadecimal233 authored Mar 18, 2023
1 parent 9c8b2a1 commit 5ea6ad2
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 124 deletions.
54 changes: 0 additions & 54 deletions src/main/java/anticope/rejects/mixin/MinecraftClientAccessor.java

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;

@Mixin(value = Account.class, remap = false)
@Mixin(value = Account.class)
public class AccountMixin {
@ModifyArg(method = "toTag", at = @At(value = "INVOKE", target = "Lnet/minecraft/nbt/NbtCompound;putString(Ljava/lang/String;Ljava/lang/String;)V", ordinal = 0), index = 1)
private String putString(String key) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;

@Mixin(value = Accounts.class, remap = false)
@Mixin(value = Accounts.class)
public class AccountsMixin {
@Inject(method = "lambda$fromTag$0", at = @At(value = "INVOKE", target = "Lnet/minecraft/nbt/NbtCompound;getString(Ljava/lang/String;)Ljava/lang/String;"), locals = LocalCapture.CAPTURE_FAILHARD, cancellable = true)
private static void onFromTag(NbtElement tag1, CallbackInfoReturnable<Account<?>> cir, NbtCompound t) {
Expand Down
45 changes: 0 additions & 45 deletions src/main/java/anticope/rejects/utils/accounts/AccountUtils.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package anticope.rejects.utils.accounts;

import com.mojang.authlib.exceptions.AuthenticationException;
import com.mojang.authlib.minecraft.MinecraftSessionService;
import meteordevelopment.meteorclient.MeteorClient;
import meteordevelopment.meteorclient.mixin.MinecraftClientAccessor;
import meteordevelopment.meteorclient.systems.accounts.Account;
Expand Down Expand Up @@ -37,9 +38,12 @@ public boolean fetchInfo() {
@Override
public boolean login() {
try {
Session session = CustomYggdrasilLogin.login(name, password, server);
CustomYggdrasilLogin.LocalYggdrasilAuthenticationService service = new CustomYggdrasilLogin.LocalYggdrasilAuthenticationService(((MinecraftClientAccessor) mc).getProxy(), server);
CustomYggdrasilLogin.applyYggdrasilAccount(service, session);
MinecraftSessionService sessService = new CustomYggdrasilLogin.LocalYggdrasilMinecraftSessionService(service, service.server);
applyLoginEnvironment(service, sessService);

Session session = CustomYggdrasilLogin.login(name, password, server);
setSession(session);
cache.username = session.getUsername();
cache.loadHead();
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.mojang.authlib.exceptions.AuthenticationException;
import com.mojang.authlib.minecraft.InsecureTextureException;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import com.mojang.authlib.minecraft.MinecraftSessionService;
import com.mojang.authlib.properties.Property;
import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
import com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService;
Expand Down Expand Up @@ -56,11 +55,6 @@ public static Session login(String name, String password, String server) throws
}
}

public static void applyYggdrasilAccount(LocalYggdrasilAuthenticationService authService, Session session) {
MinecraftSessionService service = new LocalYggdrasilMinecraftSessionService(authService, authService.server);
AccountUtils.applyLoginEnvironment(authService, service, session);
}

public static class LocalYggdrasilApi implements Environment {
private final String url;

Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/meteor-rejects.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
"GameRendererMixin",
"LivingEntityMixin",
"LivingEntityRendererMixin",
"MinecraftClientAccessor",
"MultiplayerScreenAccessor",
"MultiplayerScreenMixin",
"PlayerMoveC2SPacketAccessor",
"PlayerSkinProviderAccessor",
"ServerListAccessor",
"StructureVoidBlockMixin",
"TexturedRenderLayersMixin",
Expand Down

0 comments on commit 5ea6ad2

Please sign in to comment.