From ee391e431f345f253447f425dbc0de8625f88e65 Mon Sep 17 00:00:00 2001 From: arlo Date: Mon, 1 May 2023 13:54:38 +0100 Subject: [PATCH] removed aim assist --- .../meteorclient/systems/hud/Hud.java | 2 +- .../meteorclient/systems/modules/Modules.java | 2 - .../systems/modules/combat/AimAssist.java | 160 ------------------ 3 files changed, 1 insertion(+), 163 deletions(-) delete mode 100644 src/main/java/meteordevelopment/meteorclient/systems/modules/combat/AimAssist.java diff --git a/src/main/java/meteordevelopment/meteorclient/systems/hud/Hud.java b/src/main/java/meteordevelopment/meteorclient/systems/hud/Hud.java index 0be2713b1f..ec4d4b7f6d 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/hud/Hud.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/hud/Hud.java @@ -53,7 +53,7 @@ public class Hud extends System implements Iterable { private final Setting textScale = sgGeneral.add(new DoubleSetting.Builder() .name("text-scale") - .description("Scale of text if not overriden by the element.") + .description("Scale of text if not overridden by the element.") .defaultValue(1) .min(0.5) .sliderRange(0.5, 3) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/Modules.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/Modules.java index ee06947510..baf104c181 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/Modules.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/Modules.java @@ -381,9 +381,7 @@ public void add(Module module) { } private void initCombat() { - add(new AimAssist()); add(new AnchorAura()); -// add(new AntiAnchor()); add(new AntiAnvil()); add(new AntiBed()); add(new ArrowDodge()); diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/AimAssist.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/AimAssist.java deleted file mode 100644 index 26f0fe6510..0000000000 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/AimAssist.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client). - * Copyright (c) Meteor Development. - */ - -package meteordevelopment.meteorclient.systems.modules.combat; - -import it.unimi.dsi.fastutil.objects.Object2BooleanMap; -import meteordevelopment.meteorclient.events.render.Render3DEvent; -import meteordevelopment.meteorclient.events.world.TickEvent; -import meteordevelopment.meteorclient.settings.*; -import meteordevelopment.meteorclient.systems.friends.Friends; -import meteordevelopment.meteorclient.systems.modules.Categories; -import meteordevelopment.meteorclient.systems.modules.Module; -import meteordevelopment.meteorclient.utils.Utils; -import meteordevelopment.meteorclient.utils.entity.EntityUtils; -import meteordevelopment.meteorclient.utils.entity.SortPriority; -import meteordevelopment.meteorclient.utils.entity.Target; -import meteordevelopment.meteorclient.utils.entity.TargetUtils; -import meteordevelopment.meteorclient.utils.player.PlayerUtils; -import meteordevelopment.orbit.EventHandler; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityType; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.util.math.MathHelper; -import org.joml.Vector3d; - -public class AimAssist extends Module { - private final SettingGroup sgGeneral = settings.getDefaultGroup(); - private final SettingGroup sgSpeed = settings.createGroup("Aim Speed"); - - // General - - private final Setting>> entities = sgGeneral.add(new EntityTypeListSetting.Builder() - .name("entities") - .description("Entities to aim at.") - .defaultValue(EntityType.PLAYER) - .build() - ); - - private final Setting range = sgGeneral.add(new DoubleSetting.Builder() - .name("range") - .description("The range at which an entity can be targeted.") - .defaultValue(5) - .min(0) - .build() - ); - - private final Setting ignoreWalls = sgGeneral.add(new BoolSetting.Builder() - .name("ignore-walls") - .description("Whether or not to ignore aiming through walls.") - .defaultValue(false) - .build() - ); - - private final Setting priority = sgGeneral.add(new EnumSetting.Builder() - .name("priority") - .description("How to filter targets within range.") - .defaultValue(SortPriority.LowestHealth) - .build() - ); - - private final Setting bodyTarget = sgGeneral.add(new EnumSetting.Builder() - .name("aim-target") - .description("Which part of the entities body to aim at.") - .defaultValue(Target.Body) - .build() - ); - - // Aim Speed - - private final Setting instant = sgSpeed.add(new BoolSetting.Builder() - .name("instant-look") - .description("Instantly looks at the entity.") - .defaultValue(false) - .build() - ); - - private final Setting speed = sgSpeed.add(new DoubleSetting.Builder() - .name("speed") - .description("How fast to aim at the entity.") - .defaultValue(5) - .min(0) - .visible(() -> !instant.get()) - .build() - ); - - private final Vector3d vec3d1 = new Vector3d(); - private Entity target; - - public AimAssist() { - super(Categories.Combat, "aim-assist", "Automatically aims at entities."); - } - - @EventHandler - private void onTick(TickEvent.Post event) { - target = TargetUtils.get(entity -> { - if (!entity.isAlive()) return false; - if (!PlayerUtils.isWithin(entity, range.get())) return false; - if (!ignoreWalls.get() && !PlayerUtils.canSeeEntity(entity)) return false; - if (entity == mc.player || !entities.get().getBoolean(entity.getType())) return false; - - if (entity instanceof PlayerEntity) { - return Friends.get().shouldAttack((PlayerEntity) entity); - } - - return true; - }, priority.get()); - } - - @EventHandler - private void onRender(Render3DEvent event) { - if (target != null) aim(target, event.tickDelta, instant.get()); - } - - private void aim(Entity target, double delta, boolean instant) { - Utils.set(vec3d1, target, delta); - - switch (bodyTarget.get()) { - case Head -> vec3d1.add(0, target.getEyeHeight(target.getPose()), 0); - case Body -> vec3d1.add(0, target.getEyeHeight(target.getPose()) / 2, 0); - } - - double deltaX = vec3d1.x - mc.player.getX(); - double deltaZ = vec3d1.z - mc.player.getZ(); - double deltaY = vec3d1.y - (mc.player.getY() + mc.player.getEyeHeight(mc.player.getPose())); - - // Yaw - double angle = Math.toDegrees(Math.atan2(deltaZ, deltaX)) - 90; - double deltaAngle; - double toRotate; - - if (instant) { - mc.player.setYaw((float) angle); - } else { - deltaAngle = MathHelper.wrapDegrees(angle - mc.player.getYaw()); - toRotate = speed.get() * (deltaAngle >= 0 ? 1 : -1) * delta; - if ((toRotate >= 0 && toRotate > deltaAngle) || (toRotate < 0 && toRotate < deltaAngle)) toRotate = deltaAngle; - mc.player.setYaw(mc.player.getYaw() + (float) toRotate); - } - - // Pitch - double idk = Math.sqrt(deltaX * deltaX + deltaZ * deltaZ); - angle = -Math.toDegrees(Math.atan2(deltaY, idk)); - - if (instant) { - mc.player.setPitch((float) angle); - } else { - deltaAngle = MathHelper.wrapDegrees(angle - mc.player.getPitch()); - toRotate = speed.get() * (deltaAngle >= 0 ? 1 : -1) * delta; - if ((toRotate >= 0 && toRotate > deltaAngle) || (toRotate < 0 && toRotate < deltaAngle)) toRotate = deltaAngle; - mc.player.setPitch(mc.player.getPitch() + (float) toRotate); - } - } - - @Override - public String getInfoString() { - return EntityUtils.getName(target); - } -}