Fix Tokyo Client Crash (#283)

This commit is contained in:
OnlyRain233
2023-08-10 23:58:24 +08:00
committed by GitHub
parent 30ec0dca52
commit 8645f2dd22
4 changed files with 36 additions and 65 deletions

View File

@@ -1,5 +1,6 @@
package anticope.rejects.utils;
import anticope.rejects.MeteorRejectsAddon;
import anticope.rejects.utils.seeds.Seeds;
import meteordevelopment.meteorclient.MeteorClient;
import meteordevelopment.meteorclient.events.entity.player.PlayerMoveEvent;
@@ -17,7 +18,6 @@ import java.util.Random;
import static meteordevelopment.meteorclient.MeteorClient.mc;
public class RejectsUtils {
@PostInit
public static void init() {
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
@@ -29,7 +29,12 @@ public class RejectsUtils {
public static String getModuleName(String name) {
int dupe = 0;
for (Module module : Modules.get().getAll()) {
Modules modules = Modules.get();
if (modules == null) {
MeteorRejectsAddon.LOG.warn("Module instantiation before Modules initialized.");
return name;
}
for (Module module : modules.getAll()) {
if (module.name.equals(name)) {
dupe++;
break;
@@ -58,7 +63,7 @@ public class RejectsUtils {
return angleDistance <= fov;
}
public static float fullFlightMove(PlayerMoveEvent event, double speed, boolean verticalSpeedMatch){
public static float fullFlightMove(PlayerMoveEvent event, double speed, boolean verticalSpeedMatch) {
if (PlayerUtils.isMoving()) {
double dir = getDir();

View File

@@ -1,8 +1,8 @@
package anticope.rejects.utils.accounts;
import anticope.rejects.MeteorRejectsAddon;
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;
import meteordevelopment.meteorclient.systems.accounts.AccountType;
@@ -49,8 +49,8 @@ public class CustomYggdrasilAccount extends Account<CustomYggdrasilAccount> {
return true;
} catch (AuthenticationException e) {
if (e.getMessage().contains("Invalid username or password") || e.getMessage().contains("account migrated"))
MeteorClient.LOG.error("Wrong password.");
else MeteorClient.LOG.error("Failed to contact the authentication server.");
MeteorRejectsAddon.LOG.error("Wrong password.");
else MeteorRejectsAddon.LOG.error("Failed to contact the authentication server.");
return false;
}
}