Skip to content

Commit

Permalink
AutoLog will now disable AutoReconnect after a disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
MineGame159 committed Jul 19, 2024
1 parent 30a1b68 commit c7d2f7f
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import meteordevelopment.meteorclient.systems.friends.Friends;
import meteordevelopment.meteorclient.systems.modules.Categories;
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.utils.Utils;
import meteordevelopment.meteorclient.utils.entity.DamageUtils;
import meteordevelopment.meteorclient.utils.player.PlayerUtils;
Expand All @@ -22,7 +23,9 @@
import net.minecraft.entity.decoration.EndCrystalEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.network.packet.s2c.common.DisconnectS2CPacket;
import net.minecraft.text.MutableText;
import net.minecraft.text.Text;
import net.minecraft.util.Colors;

public class AutoLog extends Module {
private final SettingGroup sgGeneral = settings.getDefaultGroup();
Expand Down Expand Up @@ -137,7 +140,15 @@ private void onTick(TickEvent.Post event) {
}

private void disconnect(String reason) {
mc.player.networkHandler.onDisconnect(new DisconnectS2CPacket(Text.literal("[AutoLog] " + reason)));
MutableText text = Text.literal("[AutoLog] " + reason);
AutoReconnect autoReconnect = Modules.get().get(AutoReconnect.class);

if (autoReconnect.isActive()) {
text.append(Text.literal("\n\nINFO - AutoReconnect was disabled").withColor(Colors.GRAY));
autoReconnect.toggle();
}

mc.player.networkHandler.onDisconnect(new DisconnectS2CPacket(text));
}

private class StaticListener {
Expand Down

0 comments on commit c7d2f7f

Please sign in to comment.