From 1d2191c0c038bfc75b584880f6e22e978d365b33 Mon Sep 17 00:00:00 2001 From: core Date: Mon, 6 Mar 2023 17:33:38 -0500 Subject: [PATCH] mate --- .../dev/coredoes/clientmod/ClientMod.java | 1 + .../clientmod/commands/CommandParser.java | 11 +++ .../dev/coredoes/clientmod/modules/Mate.java | 74 +++++++++++++++++++ .../clientmod/modules/PacketFreezer.java | 1 - 4 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 src/main/java/dev/coredoes/clientmod/modules/Mate.java diff --git a/src/main/java/dev/coredoes/clientmod/ClientMod.java b/src/main/java/dev/coredoes/clientmod/ClientMod.java index cd5d3a2..05644cc 100644 --- a/src/main/java/dev/coredoes/clientmod/ClientMod.java +++ b/src/main/java/dev/coredoes/clientmod/ClientMod.java @@ -64,6 +64,7 @@ public class ClientMod implements ClientModInitializer { moduleManager.registerModule(new BotMovementBypass()); moduleManager.registerModule(new WorldBorderBypass()); moduleManager.registerModule(new BunkerBuster()); + moduleManager.registerModule(new Mate()); LOGGER.info("[Stage 4/5: EventInit] Registered modules; registering module event system"); moduleManager.registerEvents(); diff --git a/src/main/java/dev/coredoes/clientmod/commands/CommandParser.java b/src/main/java/dev/coredoes/clientmod/commands/CommandParser.java index 933fddb..5160119 100644 --- a/src/main/java/dev/coredoes/clientmod/commands/CommandParser.java +++ b/src/main/java/dev/coredoes/clientmod/commands/CommandParser.java @@ -3,17 +3,24 @@ package dev.coredoes.clientmod.commands; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import dev.coredoes.clientmod.ClientMod; +import dev.coredoes.clientmod.util.ConnectionInterface; import net.minecraft.client.MinecraftClient; import net.minecraft.entity.Entity; import net.minecraft.entity.mob.DrownedEntity; import net.minecraft.nbt.NbtCompound; +import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.predicate.entity.EntityPredicate; import net.minecraft.predicate.entity.EntityPredicates; import net.minecraft.text.Text; +import net.minecraft.util.Hand; import net.minecraft.util.TypeFilter; +import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.EntityHitResult; import net.minecraft.util.hit.HitResult; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Box; +import net.minecraft.util.math.Direction; +import net.minecraft.util.math.Vec3d; import java.util.List; import java.util.Objects; @@ -58,6 +65,10 @@ public class CommandParser { client.player.sendMessage(Text.of("Found drowned at " + entity.getPos().toString())); } client.player.sendMessage(Text.of("--- END DROWNED LIST ---")); + } else if (Objects.equals(command, "mate")) { + ClientMod.moduleManager.getModuleById("Mate").enable(); + } else if (Objects.equals(command, "stopMate")) { + ClientMod.moduleManager.getModuleById("Mate").disable(); } } } diff --git a/src/main/java/dev/coredoes/clientmod/modules/Mate.java b/src/main/java/dev/coredoes/clientmod/modules/Mate.java new file mode 100644 index 0000000..a664cd8 --- /dev/null +++ b/src/main/java/dev/coredoes/clientmod/modules/Mate.java @@ -0,0 +1,74 @@ +package dev.coredoes.clientmod.modules; + +import dev.coredoes.clientmod.util.ConnectionInterface; +import net.minecraft.client.MinecraftClient; +import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; +import net.minecraft.util.Hand; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.util.math.Vec3d; + +public class Mate implements Module { + private boolean enabled = false; + @Override + public void disable() { + enabled = false; + } + + @Override + public void enable() { + enabled = true; + } + + @Override + public String getId() { + return "Mate"; + } + + @Override + public String getVersion() { + return "1.0.0"; + } + + @Override + public void endTick(MinecraftClient client) { + Module.super.endTick(client); + + if (!this.enabled) return; + + doAirTpTo(client, 1332, 80, 1297); + + try { Thread.sleep(2); } catch (InterruptedException ignored) {} + + doAirTpTo(client, client.player.getX(), client.player.getY(), client.player.getZ() + 40); + // 1335 80 1339 + BlockPos blockPos = new BlockPos(1335, 80, 1339); + Direction direction = Direction.NORTH; + BlockHitResult blockHitResult = new BlockHitResult(new Vec3d(blockPos.getX(), blockPos.getY(), blockPos.getZ()), direction, blockPos, false); + client.interactionManager.interactBlock(client.player, Hand.MAIN_HAND, blockHitResult); + // sent back to: 1282 130 1288 + } + + private static void doAirTpTo(MinecraftClient client, double x, double y, double z) { + // STEP 1: Massively increase our movement cap + PlayerMoveC2SPacket packet = new PlayerMoveC2SPacket.PositionAndOnGround( + client.player.getX(), + client.player.getY(), + client.player.getZ(), + client.player.isOnGround() + ); + for (int i = 0; i < 8; i++) { + ((ConnectionInterface) client.getNetworkHandler().getConnection()).sendVolatile(packet, null); + } + // STEP 2: Send the teleport packet + PlayerMoveC2SPacket realPacket = new PlayerMoveC2SPacket.PositionAndOnGround( + x, + y, + z, + client.player.isOnGround() + ); + ((ConnectionInterface) client.getNetworkHandler().getConnection()).sendVolatile(realPacket, null); + client.player.setPosition(x, y, z); + } +} diff --git a/src/main/java/dev/coredoes/clientmod/modules/PacketFreezer.java b/src/main/java/dev/coredoes/clientmod/modules/PacketFreezer.java index 2004f72..8425bb2 100644 --- a/src/main/java/dev/coredoes/clientmod/modules/PacketFreezer.java +++ b/src/main/java/dev/coredoes/clientmod/modules/PacketFreezer.java @@ -58,7 +58,6 @@ public class PacketFreezer implements Module { event.setCancelled(true); this.packets.add(event.packet); } - ClientMod.LOGGER.info(event.packet.toString()); } private void sendAllQueuedPackets(MinecraftClient client) {