Вопрос Killaura

Начинающий
Статус
Оффлайн
Регистрация
29 Июл 2022
Сообщения
191
Реакции[?]
5
Поинты[?]
2K

Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:

  • бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
  • маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
  • приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
  • обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.

Спасибо!

у меня вопрос как в киллауре сделать так что бы при наведений на игрока голова не крутилась туда сюда
код:
Killaura:
package ru.keazclient.modules.impl.combat;

import net.minecraft.block.BlockAir;
import net.minecraft.block.BlockLiquid;
import net.minecraft.block.material.Material;
import net.minecraft.client.entity.EntityOtherPlayerMP;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityArmorStand;
import net.minecraft.entity.monster.EntityGolem;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.passive.EntitySquid;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects;
import net.minecraft.item.ItemShield;
import net.minecraft.network.play.client.CPacketEntityAction;
import net.minecraft.network.play.client.CPacketHeldItemChange;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import org.lwjgl.opengl.GL11;
import org.lwjgl.util.vector.Vector2f;
import ru.keazclient.KeazClient;
import ru.keazclient.event.EventTarget;
import ru.keazclient.event.events.impl.EventInteract;
import ru.keazclient.event.events.impl.EventMotion;
import ru.keazclient.event.events.impl.EventRender;
import ru.keazclient.event.events.impl.EventUpdate;
import ru.keazclient.modules.Module;
import ru.keazclient.modules.ModuleAnnotation;
import ru.keazclient.modules.Type;
import ru.keazclient.modules.impl.hud.ClientOverlay;
import ru.keazclient.modules.impl.player.TimerModule;
import ru.keazclient.ui.dropui.setting.imp.BooleanSetting;
import ru.keazclient.ui.dropui.setting.imp.ModeSetting;
import ru.keazclient.ui.dropui.setting.imp.MultiBoxSetting;
import ru.keazclient.ui.dropui.setting.imp.SliderSetting;
import ru.keazclient.util.GCDFixUtility;
import ru.keazclient.util.animations.AnimationMath;
import ru.keazclient.util.math.AdvancedCast;
import ru.keazclient.util.math.MathUtility;
import ru.keazclient.util.math.RayCastUtility;
import ru.keazclient.util.math.RotationUtility;
import ru.keazclient.util.movement.MoveUtility;
import ru.keazclient.util.world.InventoryUtility;

import java.awt.*;
import java.util.ArrayList;

@ModuleAnnotation(name = "AttackAura", desc = "Атакует противников", type = Type.Combat)
public class Killaura extends Module {

    public static Killaura INSTANCE;
    public static EntityLivingBase targetEntity;
    public boolean thisContextRotatedBefore;
    public float prevAdditionYaw;
    public static Vector2f rotation = new Vector2f();
    float minCPS = 0;
    public ModeSetting rotationModeSetting = new ModeSetting("Rotation Mode", "Matrix", "Matrix", "Vulcan", "Sunrise");
    public SliderSetting attackDistanceSetting = new SliderSetting("Distance", 3.3f, 0.0f, 6.0f, 0.1f);
    public SliderSetting rotateDistanceSetting = new SliderSetting("Rotate Distance", 1.5f, 0.0f, 3.0f, 0.1f);
    public MultiBoxSetting targetSelectionSetting = new MultiBoxSetting("Targets Selection", new String[]{"Players", "Mobs", "Animals", "Villagers"});
    public BooleanSetting randomClicks = new BooleanSetting("Random Clicks", false, () -> rotationModeSetting.is("Vulcan"));
    public BooleanSetting rayTraceSetting = new BooleanSetting("RayTrace", true);
    public BooleanSetting resolverSetting = new BooleanSetting("Resolver", false);
    public BooleanSetting keepSprintSetting = new BooleanSetting("Keep Sprint", true);
    public BooleanSetting stopAttackSetting = new BooleanSetting("No Damage On Eating", true);
    public BooleanSetting onlyCriticalSetting = new BooleanSetting("Only Critical", true);
    public BooleanSetting waterCriticalSetting = new BooleanSetting("Water Critical", true, () -> onlyCriticalSetting.get());
    public BooleanSetting shieldBreakerSetting = new BooleanSetting("Shield Breaker", true);
    public BooleanSetting targetESP = new BooleanSetting("Target ESP", false);
    public SliderSetting circleSpeed = new SliderSetting("Circle Speed", 2, 1, 5, 0.01f, () -> targetESP.get());
    public static double prevCircleStep, circleStep;
    

    @EventTarget
    public void onInteractEntity(EventInteract e) {
        if (targetEntity != null) {
            e.cancel();
        }
    }

    @EventTarget
    public void onUpdateAura(EventUpdate eventUpdate) {
        if (resolverSetting.get()) {
            resolvePlayers();
        }
        onAura();
        if (resolverSetting.get()) {
            releaseResolver();
        }
    }

    @EventTarget
    public void onMotion(EventMotion eventMotion) {
        if (targetEntity != null) {
            mc.player.rotationYawHead = rotation.x;
            mc.player.renderYawOffset = rotation.x;
            eventMotion.setYaw(rotation.x);
            eventMotion.setPitch(rotation.y);
        }
    }

    @EventTarget
    public void onRender(EventRender e) {
        if (targetEntity != null && targetESP.get()) {

            prevCircleStep = circleStep;
            circleStep += circleSpeed.get() * AnimationMath.deltaTime();

            float eyeHeight = targetEntity.getEyeHeight();
            if (targetEntity.isSneaking()) eyeHeight -= 0.2f;

            double cs = prevCircleStep + (circleStep - prevCircleStep) * mc.getRenderPartialTicks();
            double prevSinAnim = Math.abs(1 + Math.sin(cs - 0.5)) / 2;
            double sinAnim = Math.abs(1 + Math.sin(cs)) / 2;
            double x = targetEntity.lastTickPosX + (targetEntity.posX - targetEntity.lastTickPosX) * mc.getRenderPartialTicks()
                    - mc.getRenderManager().renderPosX;
            double y = targetEntity.lastTickPosY + (targetEntity.posY - targetEntity.lastTickPosY) * mc.getRenderPartialTicks()
                    - mc.getRenderManager().renderPosY + prevSinAnim * eyeHeight;
            double z = targetEntity.lastTickPosZ + (targetEntity.posZ - targetEntity.lastTickPosZ) * mc.getRenderPartialTicks()
                    - mc.getRenderManager().renderPosZ;
            double nextY = targetEntity.lastTickPosY
                    + (targetEntity.posY - targetEntity.lastTickPosY) * mc.getRenderPartialTicks()
                    - mc.getRenderManager().renderPosY + sinAnim * eyeHeight;

            GL11.glPushMatrix();
            GL11.glDisable(GL11.GL_CULL_FACE);
            GL11.glDisable(GL11.GL_TEXTURE_2D);
            GL11.glEnable(GL11.GL_BLEND);
            GL11.glDisable(GL11.GL_DEPTH_TEST);
            GL11.glDisable(GL11.GL_ALPHA_TEST);
            GL11.glShadeModel(GL11.GL_SMOOTH);
            GL11.glBegin(GL11.GL_QUAD_STRIP);
            for (int i = 0; i <= 360; i++) {
                final Color color = ClientOverlay.getColor(i);
                GL11.glColor4f(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, 0.6F);
                GL11.glVertex3d(x + Math.cos(Math.toRadians(i)) * targetEntity.width * 0.8, nextY,
                        z + Math.sin(Math.toRadians(i)) * targetEntity.width * 0.8);
                GL11.glColor4f(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, 0.01F);
                GL11.glVertex3d(x + Math.cos(Math.toRadians(i)) * targetEntity.width * 0.8, y,
                        z + Math.sin(Math.toRadians(i)) * targetEntity.width * 0.8);
            }
            GL11.glEnd();
            GL11.glEnable(GL11.GL_LINE_SMOOTH);
            GL11.glBegin(GL11.GL_LINE_LOOP);
            for (int i = 0; i <= 360; i++) {
                final Color color = ClientOverlay.getColor(i);
                GL11.glColor4f(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, 0.8F);
                GL11.glVertex3d(x + Math.cos(Math.toRadians(i)) * targetEntity.width * 0.8, nextY,
                        z + Math.sin(Math.toRadians(i)) * targetEntity.width * 0.8);
            }
            GL11.glEnd();
            GL11.glDisable(GL11.GL_LINE_SMOOTH);
            GL11.glEnable(GL11.GL_TEXTURE_2D);
            GL11.glEnable(GL11.GL_ALPHA_TEST);
            GL11.glEnable(GL11.GL_DEPTH_TEST);
            GL11.glShadeModel(GL11.GL_FLAT);
            GL11.glDisable(GL11.GL_BLEND);
            GL11.glEnable(GL11.GL_CULL_FACE);
            GL11.glPopMatrix();
            GlStateManager.resetColor();
        }
    }

    public void onAura() {
        minCPS = MathUtility.clamp(minCPS, 0, 12 * (KeazClient.getInstance().manager.getModule(TimerModule.class).state ? TimerModule.timerAmount.getFloatValue() : 1));
        if (minCPS > 0) {
            minCPS--;
        }

        if (targetEntity != null) {
            if (!isValidTarget(targetEntity)) {
                targetEntity = null;
            }
        }

        if (targetEntity == null) targetEntity = findTarget();

        if (targetEntity == null) {
            rotation.x = mc.player.rotationYaw;
            rotation.y = mc.player.rotationPitch;
            return;
        }

        this.thisContextRotatedBefore = false;
        attackMethod(targetEntity);

        if (!this.thisContextRotatedBefore && !rotationModeSetting.is("Nexus")) {
            getVectorRotation(targetEntity, false);
        }
    }

    public void attackMethod(Entity entity) {
        if (whenFalling() && (minCPS == 0)) {
            if (getHitBox(entity, attackDistanceSetting.getFloatValue()) == null && rayTraceSetting.get()) {
                return;
            }

            if (keepSprintSetting.state) {
                mc.player.connection.sendPacket(new CPacketEntityAction(mc.player, CPacketEntityAction.Action.STOP_SPRINTING));
            }
            getVectorRotation(entity, true);
            if (AdvancedCast.instance.getMouseOver(entity, rotation.x, rotation.y, attackDistanceSetting.getDoubleValue(), ignoreWalls()) == entity) {
                if (mc.player.isActiveItemStackBlocking()) mc.playerController.onStoppedUsingItem(mc.player);
                if (KeazClient.getInstance().manager.getModule(TimerModule.class).state) {
                    minCPS = 30 * TimerModule.timerAmount.getFloatValue();
                } else {
                    minCPS = 10;
                }

                if (stopAttackSetting.state) {
                    if (mc.player.isEating()) {
                        mc.player.swingArm(EnumHand.MAIN_HAND);
                    } else {
                        mc.playerController.attackEntity(mc.player, targetEntity);
                        mc.player.swingArm(EnumHand.MAIN_HAND);
                        mc.player.resetCooldown();
                        breakShieldMethod((EntityPlayer) entity);
                    }
                }

                if (!stopAttackSetting.state) {
                    mc.playerController.attackEntity(mc.player, targetEntity);
                    mc.player.swingArm(EnumHand.MAIN_HAND);
                    mc.player.resetCooldown();
                    breakShieldMethod((EntityPlayer) entity);
                }
            }
        }
    }

    public void breakShieldMethod(EntityPlayer entity) {
        if (InventoryUtility.doesHotbarHaveAxe() && shieldBreakerSetting.get()) {
            int item = InventoryUtility.getAxe();
            if (entity != null && entity.getActiveItemStack().getItem() instanceof ItemShield) {
                mc.player.connection.sendPacket(new CPacketHeldItemChange(item));
                mc.playerController.attackEntity(mc.player, entity);
                mc.player.swingArm(EnumHand.MAIN_HAND);
                mc.player.resetCooldown();
                mc.player.connection.sendPacket(new CPacketHeldItemChange(mc.player.inventory.currentItem));
            }
        }
    }

    public void getVectorRotation(Entity entity, boolean attackContext) {
        this.thisContextRotatedBefore = true;

        Vec3d vec = getHitBox(entity, rotateDistanceSetting.getFloatValue() + attackDistanceSetting.getFloatValue());
        if (vec == null) {
            vec = entity.getPositionEyes(1);
        }

        float sensitivity = 1.0001f;
        double x, y, z;

        x = vec.x - mc.player.posX;
        y = vec.y - (mc.player.posY + mc.player.getEyeHeight());
        z = vec.z - mc.player.posZ;

        double dst = Math.sqrt(Math.pow(x, 2) + Math.pow(z, 2));

        float yawToTarget = (float) MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(z, x)) - 90);
        float pitchToTarget = (float) (-Math.toDegrees(Math.atan2(y, dst)));
        float yawDelta = MathHelper.wrapDegrees(yawToTarget - rotation.x) / sensitivity;
        float pitchDelta = (pitchToTarget - rotation.y) / sensitivity;

        if (yawDelta > 180) yawDelta = yawDelta - 180;
        if (Math.abs(yawDelta) < 180.0f) {
            if (rotationModeSetting.is("Vulcan")) {
                if (attackContext) {
                    int yawDeltaAbs = (int) Math.abs(yawDelta);
                    int pitchDeltaAbs = (int) Math.abs(pitchDelta);
                    if (Math.abs(yawDeltaAbs - this.prevAdditionYaw) <= 3.0f) {
                        yawDeltaAbs = (int) GCDFixUtility.getFixedRotation(this.prevAdditionYaw + 3.1f);
                    }
                    float newYaw = rotation.x + (yawDelta > 0 ? yawDeltaAbs : -yawDeltaAbs) * sensitivity;
                    float newPitch = MathHelper.clamp(rotation.y + (pitchDelta > 0 ? (pitchDeltaAbs) : -(pitchDeltaAbs)) * sensitivity, -90, 90);
                    rotation.x = newYaw;
                    rotation.y = newPitch;
                    prevAdditionYaw = yawDeltaAbs;
                }
            }
            if (rotationModeSetting.is("Nexus")) {
                if (attackContext) {
                    int pitchDeltaAbs = (int) Math.abs(pitchDelta);
                    int yawDeltaAbs = (int) Math.abs(yawDelta);
                    if (Math.abs(yawDeltaAbs - this.prevAdditionYaw) <= 3.0f) {
                        yawDeltaAbs = (int) GCDFixUtility.getFixedRotation(this.prevAdditionYaw + 3.1f);
                    }
                    float newYaw = rotation.x + (yawDelta > 0 ? yawDeltaAbs : -yawDeltaAbs) * sensitivity;
                    float newPitch = MathHelper.clamp(rotation.y + (pitchDelta > 0 ? (pitchDeltaAbs) : -(pitchDeltaAbs)) * sensitivity, -90, 90);
                    rotation.x = newYaw;
                    rotation.y = newPitch;
                    mc.player.rotationYaw = newYaw;
                    mc.player.rotationPitch = newPitch;
                    prevAdditionYaw = yawDeltaAbs;
                }
            } else {
                float additionYaw = Math.min(Math.max(Math.abs(yawDelta), 1), 40);
                float additionPitch = Math.max(attackContext ? Math.abs(pitchDelta) : 1, rotationModeSetting.is("Sunrise") ? 1 : 3);
                if (Math.abs(additionYaw - this.prevAdditionYaw) <= 3.0f) {
                    additionYaw = GCDFixUtility.getFixedRotation(this.prevAdditionYaw + 3.1f);
                }
                float yaw = rotation.x + (yawDelta > 0 ? additionYaw : -additionYaw) * sensitivity;
                float pitch = rotation.y + (pitchDelta > 0 ? additionPitch : -additionPitch) * sensitivity;
                pitch = MathHelper.clamp(pitch, -90, 90);
                rotation.x = yaw;
                rotation.y = pitch;
                prevAdditionYaw = additionYaw;
            }
        }
    }

    public boolean ignoreWalls() {
        BlockPos pos = new BlockPos(mc.player.lastReportedPosX, mc.player.lastReportedPosY, mc.player.lastReportedPosZ);
        return mc.world.getBlockState(pos).getMaterial() == Material.AIR;
    }

    public boolean whenFalling() {
        boolean critWater = waterCriticalSetting.get() && mc.world.getBlockState(new BlockPos(mc.player.posX, mc.player.posY, mc.player.posZ)).getBlock() instanceof BlockLiquid && mc.world.getBlockState(new BlockPos(mc.player.posX, mc.player.posY + 1, mc.player.posZ)).getBlock() instanceof BlockAir;

        boolean reason = mc.player.isPotionActive(MobEffects.BLINDNESS) || mc.player.isOnLadder() || mc.player.isInWater() && !critWater || mc.player.isInWeb || mc.player.capabilities.isFlying;

        if (mc.player.getCooledAttackStrength(1.5f) < 0.92f) {
            return false;
        }

        if (onlyCriticalSetting.state && !reason) {
            if (MoveUtility.isBlockAboveHead() && mc.player.onGround && mc.player.fallDistance > 0) {
                return true;
            }

            return (!mc.player.onGround && mc.player.fallDistance > (randomClicks.get() && rotationModeSetting.is("Vulcan") ? MathUtility.randomizeFloat(0, 0.3f) : 0));
        }

        return true;
    }

    public EntityLivingBase findTarget() {
        ArrayList<EntityLivingBase> entity = new ArrayList<>();

        for (Entity player : mc.world.loadedEntityList) {
            if (!(player instanceof EntityLivingBase)) continue;
            if (isValidTarget((EntityLivingBase) player)) {
                entity.add((EntityLivingBase) player);
                continue;
            }
            entity.remove(player);
        }

        entity.sort((e1, e2) -> {
            int dst1 = (int) (mc.player.getDistance(e1) * 1000);
            int dst2 = (int) (mc.player.getDistance(e2) * 1000);
            return dst1 - dst2;
        });

        return entity.isEmpty() ? null : entity.get(0);
    }

    public boolean isValidTarget(EntityLivingBase e) {
        if (e == this.mc.player)
            return false;
        if (e.isDead)
            return false;
        if (e.getHealth() <= 0)
            return false;
        if (e instanceof EntityArmorStand)
            return false;
        if (e instanceof EntityPlayer && !targetSelectionSetting.get(0))
            return false;
        if (KeazClient.getInstance().friendManager.isFriend(e.getName()))
            return false;
        if (KeazClient.getInstance().manager.getModule(AntiBotModule.class).state && AntiBotModule.isBotPlayer.contains(e))
            return false;
        if (e instanceof EntityMob && !targetSelectionSetting.get(1))
            return false;
        if ((e instanceof EntityAnimal || e instanceof EntityGolem || e instanceof EntitySquid || e instanceof EntityVillager) && !targetSelectionSetting.get(2))
            return false;
        if (e instanceof EntityVillager && targetSelectionSetting.get(3))
            return false;
        if (!ignoreWalls()) {
            if (getHitBox(e, attackDistanceSetting.getDoubleValue() + rotateDistanceSetting.getDoubleValue()) == null) {
                return false;
            }
        } else return !(e.getDistance(mc.player) > attackDistanceSetting.getDoubleValue() + rotateDistanceSetting.getDoubleValue());

        return true;
    }

    public void resolvePlayers() {
        for (EntityPlayer player : mc.world.playerEntities) {
            if (player instanceof EntityOtherPlayerMP) {
                ((EntityOtherPlayerMP) player).resolve();
            }
        }
    }

    public void releaseResolver() {
        for (EntityPlayer player : mc.world.playerEntities) {
            if (player instanceof EntityOtherPlayerMP) {
                ((EntityOtherPlayerMP) player).releaseResolver();
            }
        }
    }

    public Vec3d getHitBox(Entity entity, double rotateDistance) {
        Vec3d vec = entity.getPositionVector().add(new Vec3d(0, MathHelper.clamp(entity.getEyeHeight() * (mc.player.getDistance(entity) / (attackDistanceSetting.getFloatValue() + rotateDistanceSetting.getFloatValue()) + entity.width), 0.2, mc.player.getEyeHeight()), 0));

        ArrayList<Vec3d> points = new ArrayList<>();
        points.add(vec);
        points.removeIf(point -> !isHitBoxVisible(entity, point, rotateDistance));
        if (points.isEmpty()) {
            return null;
        }
        points.sort((d1, d2) -> {
            Vector2f r1 = RotationUtility.getDeltaForCoord(rotation, d1);
            Vector2f r2 = RotationUtility.getDeltaForCoord(rotation, d2);
            float y1 = Math.abs(r1.y);
            float y2 = Math.abs(r2.y);
            return (int) ((y1 - y2) * 1000);
        });
        return points.get(0);
    }

    public boolean isHitBoxVisible(Entity target, Vec3d vector, double dst) {
        return RayCastUtility.getPointedEntity(RotationUtility.getRotationForCoord(vector), dst, 1, !ignoreWalls(), target) == target;
    }

    @Override
    public void onDisable() {
        targetEntity = null;
        rotation.x = mc.player.rotationYaw;
        rotation.y = mc.player.rotationPitch;
        super.onDisable();
    }
}
 
Сверху Снизу