Fix Mixin Crash (#215)

This commit is contained in:
Soda5601
2023-01-31 16:00:22 +08:00
committed by GitHub
parent ad06a17a88
commit 8067589417
5 changed files with 13 additions and 35 deletions

View File

@@ -1,8 +1,3 @@
/*
* This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client).
* Copyright (c) Meteor Development.
*/
package anticope.rejects.modules;
import anticope.rejects.MeteorRejectsAddon;

View File

@@ -1,8 +1,3 @@
/*
* This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client).
* Copyright (c) Meteor Development.
*/
package anticope.rejects.modules;
import anticope.rejects.MeteorRejectsAddon;
@@ -63,7 +58,7 @@ public class AutoLogin extends Module {
public AutoLogin() {
super(MeteorRejectsAddon.CATEGORY, "auto-login", "Runs command when joining specified server.");
MeteorClient.EVENT_BUS.subscribe(new Listener());
runInMainMenu = true;
}
@Override
@@ -79,19 +74,17 @@ public class AutoLogin extends Module {
return l;
}
private class Listener {
@EventHandler
private void onGameJoined(GameJoinedEvent event) {
if (!isActive()) return;
String command = commands.get().getOrDefault("*", commands.get().get(Utils.getWorldName()));
if (command != null) {
timer.schedule(new TimerTask() {
@Override
public void run() {
if (mc.player != null) ChatUtils.sendPlayerMsg(command);
}
}, delay.get());
}
@EventHandler
private void onGameJoined(GameJoinedEvent event) {
if (!isActive()) return;
String command = commands.get().getOrDefault("*", commands.get().get(Utils.getWorldName()));
if (command != null) {
timer.schedule(new TimerTask() {
@Override
public void run() {
if (mc.player != null) ChatUtils.sendPlayerMsg(command);
}
}, delay.get());
}
}