diff --git a/gradle.properties b/gradle.properties index 595c84a..fafb27c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ yarn_mappings=1.20+build.1 loader_version=0.14.21 # Mod Properties -mod_version=1.2.0 +mod_version=1.2.2 maven_group=de.gurkenwerfer archives_base_name=gurkens-gadgetry diff --git a/src/main/java/de/gurkenwerfer/toolkit/GurkensGadgetry.java b/src/main/java/de/gurkenwerfer/toolkit/GurkensGadgetry.java index ead63bf..65f0f48 100644 --- a/src/main/java/de/gurkenwerfer/toolkit/GurkensGadgetry.java +++ b/src/main/java/de/gurkenwerfer/toolkit/GurkensGadgetry.java @@ -33,7 +33,7 @@ public void onInitialize() { // Commands // just use meteor until I fix this - // Commands.add(new CamClip()); + Commands.add(new CamClip()); } @Override diff --git a/src/main/java/de/gurkenwerfer/toolkit/commands/CamClip.java b/src/main/java/de/gurkenwerfer/toolkit/commands/CamClip.java index 5fe1b17..1b2e59b 100644 --- a/src/main/java/de/gurkenwerfer/toolkit/commands/CamClip.java +++ b/src/main/java/de/gurkenwerfer/toolkit/commands/CamClip.java @@ -1,56 +1,35 @@ package de.gurkenwerfer.toolkit.commands; import com.mojang.brigadier.builder.LiteralArgumentBuilder; -import de.gurkenwerfer.toolkit.mixins.ClientConnectionAccessor; -import de.gurkenwerfer.toolkit.modules.Gurkwalk; import meteordevelopment.meteorclient.commands.Command; -import meteordevelopment.meteorclient.systems.modules.Modules; -import net.minecraft.client.MinecraftClient; import net.minecraft.command.CommandSource; -import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.text.Text; -import net.minecraft.util.math.Vec3d; import static com.mojang.brigadier.Command.SINGLE_SUCCESS; import static meteordevelopment.meteorclient.MeteorClient.mc; public class CamClip extends Command { public CamClip() { - super("CamClip", "Gets your camera's Y position and tries to clip there vertically."); + super("camclip", "Gets your camera's Y position and tries to clip there vertically."); } @Override public void build(LiteralArgumentBuilder builder) { builder.executes(context -> { - // int y = (int) mc.player.getY(); - //int y = (int) mc.cameraEntity.getY(); assert mc.crosshairTarget != null; int y = (int) mc.crosshairTarget.getPos().getY(); assert mc.player != null; mc.player.sendMessage(Text.of("Clipping to y = " + y), false); - for (int i = 0; i < 13; i++) { - sendPositionPacket(mc.player.getPos()); + for (int i = 0; i < 9; i++) { + mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.OnGroundOnly(true)); } - sendPositionPacket(new Vec3d(mc.player.getX(), y, mc.player.getZ())); + mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), y, mc.player.getZ(), true)); return SINGLE_SUCCESS; }); } - public static void sendPositionPacket(Vec3d pos) { - - MinecraftClient mc = MinecraftClient.getInstance(); - // Check if coords should be rounded - Gurkwalk gw = Modules.get().get(Gurkwalk.class); - if (gw.isActive()) { - Packet positionPacket = new PlayerMoveC2SPacket.PositionAndOnGround(gw.round(pos.getX()), pos.getY(), gw.round(pos.getZ()), true); - ((ClientConnectionAccessor) mc.getNetworkHandler().getConnection())._sendImmediately(positionPacket, null); - } else { - Packet positionPacket = new PlayerMoveC2SPacket.PositionAndOnGround(pos.getX(), pos.getY(), pos.getZ(), true); - ((ClientConnectionAccessor) mc.getNetworkHandler().getConnection())._sendImmediately(positionPacket, null); - } - } }