AutoTPaccept module

AutoTPaccept: Minecraft 26.3 cheat module, full source for every implementation (1 client: MelaHack (ThunderHack fork)).

1 implementationMISC

Clients with this module

Full module source: 1 implementation

Every implementation below is the complete module file, verbatim. Expand a client to read its code.

MelaHack (ThunderHack fork)MISCsrc/main/java/thunder/hack/features/modules/misc/AutoTpAccept.javaJava · 77 lines · 3.3 KB

Automatically accepts teleport requests.

SettingsGriefonlyFriendsDuoTimeOut
AutoTpAccept.javaJava · Minecraft 26.2 · 77 lines · 3.3 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.features.modules.misc;
2
3
import meteordevelopment.orbit.EventHandler;
4
import net.minecraft.client.gui.GuiGraphicsExtractor;
5
import net.minecraft.network.protocol.game.ClientboundSystemChatPacket;
6
import net.minecraft.world.entity.player.Player;
7
import thunder.hack.core.Managers;
8
import thunder.hack.events.impl.PacketEvent;
9
import thunder.hack.gui.font.FontRenderers;
10
import thunder.hack.features.modules.Module;
11
import thunder.hack.features.modules.client.HudEditor;
12
import thunder.hack.setting.Setting;
13
import thunder.hack.utility.ThunderUtility;
14
import thunder.hack.utility.math.MathUtility;
15
16
import static thunder.hack.features.modules.client.ClientSettings.isRu;
17
18
public class AutoTpAccept extends Module {
19
    public AutoTpAccept() {
20
        super("AutoTPaccept", Category.MISC);
21
    }
22
23
    public Setting<Boolean> grief = new Setting<>("Grief", false);
24
    public Setting<Boolean> onlyFriends = new Setting<>("onlyFriends", true);
25
    public Setting<Boolean> duo = new Setting<>("Duo", false);
26
    private final Setting<Integer> timeOut = new Setting<>("TimeOut", 60, 1, 180, v -> duo.getValue());
27
28
    private TpTask tpTask;
29
30
    @EventHandler
31
    public void onPacketReceive(PacketEvent.Receive event) {
32
        if (fullNullCheck()) return;
33
        if (event.getPacket() instanceof ClientboundSystemChatPacket) {
34
            final ClientboundSystemChatPacket packet = event.getPacket();
35
            if (packet.content().getString().contains("телепортироваться") || packet.content().getString().contains("tpaccept")) {
36
                if (onlyFriends.getValue()) {
37
                    if (Managers.FRIEND.isFriend(ThunderUtility.solveName(packet.content().getString()))) {
38
                        if (!duo.getValue()) acceptRequest(packet.content().getString());
39
                        else
40
                            tpTask = new TpTask(() -> acceptRequest(packet.content.getString()), System.currentTimeMillis());
41
                    }
42
                } else acceptRequest(packet.content().getString());
43
            }
44
        }
45
    }
46
47
    public void onRender2D(GuiGraphicsExtractor context) {
48
        if (duo.getValue() && tpTask != null) {
49
            String text = (isRu() ? "Ждем таргета " : "Awaiting target ") + MathUtility.round((timeOut.getValue() * 1000 - (System.currentTimeMillis() - tpTask.time())) / 1000f, 1);
50
            FontRenderers.sf_bold.drawCenteredString(context.pose(), text, mc.getWindow().getGuiScaledWidth() / 2f, mc.getWindow().getGuiScaledHeight() / 2f + 30, HudEditor.getColor(1).getRGB());
51
        }
52
    }
53
54
    @Override
55
    public void onUpdate() {
56
        if (duo.getValue() && tpTask != null) {
57
            if (System.currentTimeMillis() - tpTask.time > timeOut.getValue() * 1000) {
58
                tpTask = null;
59
                return;
60
            }
61
            for (Player pl : mc.level.players()) {
62
                if (pl == mc.player) continue;
63
                if (Managers.FRIEND.isFriend(pl)) continue;
64
                tpTask.task.run();
65
                tpTask = null;
66
                break;
67
            }
68
        }
69
    }
70
71
    public void acceptRequest(String name) {
72
        if (grief.getValue()) mc.getConnection().sendCommand("tpaccept " + ThunderUtility.solveName(name));
73
        else mc.getConnection().sendCommand("tpaccept");
74
    }
75
76
    private record TpTask(Runnable task, long time) {}
77
}