package im.Exo.functions.impl.combat;
import com.google.common.eventbus.Subscribe;
import im.Exo.Exo;
import im.Exo.command.friends.FriendStorage;
import im.Exo.events.EventDisplay;
import im.Exo.events.EventInput;
import im.Exo.events.EventMotion;
import im.Exo.events.EventUpdate;
import im.Exo.functions.api.Category;
import im.Exo.functions.api.Function;
import im.Exo.functions.api.FunctionRegister;
import im.Exo.functions.impl.render.HUD;
import im.Exo.functions.settings.impl.BooleanSetting;
import im.Exo.functions.settings.impl.ModeListSetting;
import im.Exo.functions.settings.impl.ModeSetting;
import im.Exo.functions.settings.impl.SliderSetting;
import im.Exo.utils.math.SensUtils;
import im.Exo.utils.math.StopWatch;
import im.Exo.utils.math.VectorUtils;
import im.Exo.utils.player.InventoryUtil;
import im.Exo.utils.player.MouseUtil;
import im.Exo.utils.player.MoveUtils;
import im.Exo.utils.render.ColorUtils;
import im.Exo.utils.render.DisplayUtils;
import lombok.Getter;
import net.minecraft.client.entity.player.ClientPlayerEntity;
import net.minecraft.client.settings.PointOfView;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.enchantment.Enchantments;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.item.ArmorStandEntity;
import net.minecraft.entity.monster.MonsterEntity;
import net.minecraft.entity.passive.AnimalEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.container.ClickType;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.ItemStack;
import net.minecraft.network.play.client.CHeldItemChangePacket;
import net.minecraft.tags.FluidTags;
import net.minecraft.util.Hand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector2f;
import net.minecraft.util.math.vector.Vector3d;
import java.awt.*;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
import static java.lang.Math.hypot;
import static net.minecraft.util.math.MathHelper.*;
@FunctionRegister(name = "KillAura", type = Category.Combat)
public class KillAura extends Function {
[USER=270918]@Getter[/USER]
private final ModeSetting type = new ModeSetting("Тип", "Плавная", "Плавная", "Фантайм","Новая","ФантаймСнап","ФантаймЛегит");
private final SliderSetting attackRange = new SliderSetting("Дистанция аттаки", 3f, 2f, 6f, 0.1f);
private final SliderSetting rotateDistance = new SliderSetting("Дистанция наводки", 1f,0f,3f,0.1f);
final ModeListSetting targets = new ModeListSetting("Таргеты",
new BooleanSetting("Игроки", true),
new BooleanSetting("Голые", true),
new BooleanSetting("Мобы", false),
new BooleanSetting("Животные", false),
new BooleanSetting("Друзья", false),
new BooleanSetting("Голые невидимки", true),
new BooleanSetting("Невидимки", true));
[USER=270918]@Getter[/USER]
final ModeListSetting options = new ModeListSetting("Опции",
new BooleanSetting("Только Криты",true),
new BooleanSetting("Криты с пробелом",true),
new BooleanSetting("Ломать щит", true),
new BooleanSetting("Отжимать щит", true),
new BooleanSetting("Синхронизировать ТПС", false),
new BooleanSetting("Коррекция движения", true));
final ModeSetting sort = new ModeSetting("Сортировка", "По дистанции", "По всему", "По здоровью","По дистанции");
final ModeSetting crit = new ModeSetting("Крит хелперы","None","None","Grim all");
final ModeSetting correctionType = new ModeSetting("Тип коррекции", "Незаметный", "Незаметный", "Сфокусированный").setVisible(()-> options.getValueByName("Коррекция движения").get());
[USER=270918]@Getter[/USER]
private final StopWatch stopWatch = new StopWatch();
private Vector2f rotateVector = new Vector2f(0, 0);
[USER=270918]@Getter[/USER]
private LivingEntity target;
private Entity selected;
private final SliderSetting yawSpeed = new SliderSetting("Скорость yaw", 25f, 15f, 50f, 0.5f);
private final SliderSetting pitchSpeed = new SliderSetting("Скорость pitch", 10f, 5f, 25f, 0.5f);
private final ModeSetting mode2 = new ModeSetting("FOV", "Круг", "Круг", "Выкл");
int ticks = 0;
boolean isRotated;
final AutoPotion autoPotion;
final AutoHeal autoHeal;
final Criticals criticals;
public KillAura(AutoPotion autoPotion,AutoHeal autoHeal,Criticals criticals) {
this.autoHeal = autoHeal;
this.criticals = criticals;
this.autoPotion = autoPotion;
addSettings(mode2,type,crit,attackRange,rotateDistance, targets,sort,options, correctionType);
}
@Subscribe
public void onInput(EventInput eventInput) {
if (eventInput != null && options.getValueByName("Коррекция движения").get() && correctionType.is("Незаметный")) {
MoveUtils.fixMovement(eventInput, rotateVector.x);
}
}
@Subscribe
public void onUpdate(EventUpdate e) {
updateTarget();
if (target != null && !(!autoPotion.isState() && autoPotion.isActive())) {
isRotated = false;
if (shouldPlayerFalling() && (stopWatch.hasTimeElapsed())) {
updateAttack();
ticks = 2;
}
if (type.is("Фантайм")) {
if (ticks > 0 && LookTarget2(target)) {
updateRotation(true, 20, 60);
ticks--;
} else {
reset();
}
} else {
if (!isRotated) {
updateRotation(false, yawSpeed.get(), pitchSpeed.get());
}
}
if (shouldPlayerFalling() && (stopWatch.hasTimeElapsed())) {
updateAttack();
ticks = 2;
}
if (type.is("Новая")) {
if (ticks > 0) {
updateRotation(true, 180, 90);
} else {
reset();
}
}
} else {
stopWatch.setLastMS(0);
reset();
}
if (type.is("ФантаймСнап")) {
if (ticks > 0) {
updateRotation(true, 25,80 );
ticks--;
} else {
reset();
}
} else {
if (!isRotated) {
updateRotation(true, yawSpeed.get(), pitchSpeed.get());
}
}
if (type.is("ФантаймЛегит")) {
if (ticks > 0 && LookTarget(target)) {
updateRotation(true, 50, 90);
ticks--;
} else {
reset();
}
} else {
if (!isRotated) {
updateRotation(false, yawSpeed.get(), pitchSpeed.get());
}
}
if (shouldPlayerFalling() && (stopWatch.hasTimeElapsed())) {
updateAttack();
ticks = 2;
}
if (crit.is("Grim all")) {
if (shouldPlayerFalling() && (stopWatch.hasTimeElapsed())) {
if (mc.player.isSprinting()) {
mc.player.setSprinting(false);
}
updateAttack();
ticks = 0;
}
}
}
private boolean LookTarget2(LivingEntity target) {
Vector3d playerDirection = mc.player.getLook(0.0F);
Vector3d targetDirection = target.getPositionVec().subtract(mc.player.getEyePosition(1.0F)).normalize();
double angle = Math.toDegrees(Math.acos(playerDirection.dotProduct(targetDirection)));
return angle <= 108.5;
}
private boolean LookTarget(LivingEntity target) {
Vector3d playerDirection = mc.player.getLook(0.0F);
Vector3d targetDirection = target.getPositionVec().subtract(mc.player.getEyePosition(1.0F)).normalize();
double angle = Math.toDegrees(Math.acos(playerDirection.dotProduct(targetDirection)));
return angle <= 38.5;
}
@Subscribe
private void onWalking(EventMotion e) {
if (this.target != null) {
float yaw;
float pitch;
if (!this.autoHeal.isActive() && this.autoPotion.isState() && this.autoPotion.isActive()) {
yaw = this.rotateVector.x;
pitch = this.rotateVector.y;
e.setYaw(yaw);
e.setPitch(pitch);
mc.player.rotationYawHead = yaw;
mc.player.renderYawOffset = yaw;
mc.player.rotationPitchHead = pitch;
} else {
yaw = this.rotateVector.x;
pitch = this.rotateVector.y;
float headRot = mc.player.prevRotationYawHead;
float maxHeadRot = 40.0F;
float bodRot = mc.player.prevRotationYaw;
float bodYaw;
if (Math.abs(headRot - bodRot) > maxHeadRot) {
if (headRot > bodRot) {
bodYaw = headRot + ThreadLocalRandom.current().nextFloat(1.0F, 15.0F);
} else {
bodYaw = headRot - ThreadLocalRandom.current().nextFloat(1.0F, 15.0F);
}
} else {
bodYaw = bodRot;
}
float newBodYaw = Math.min(Math.max(bodYaw, 0.0F), 10.0F);
mc.player.renderYawOffset = bodYaw;
mc.player.rotationYawHead = yaw;
mc.player.rotationPitchHead = pitch;
e.setYaw(yaw);
e.setPitch(pitch);
}
}
}
private void updateTarget() {
List<LivingEntity> targets = new ArrayList<>();
for (Entity entity : mc.world.getAllEntities()) {
if (entity instanceof LivingEntity living && isValid(living)) {
targets.add(living);
}
}
if (targets.isEmpty()) {
target = null;
return;
}
if (targets.size() == 1) {
target = targets.get(0);
return;
}
if (targets.size() > 1) {
switch (sort.get()) {
case "По всему" -> {
targets.sort(Comparator.comparingDouble(target -> {
if (target instanceof PlayerEntity player) {
return -this.getEntityArmor(player);
}
if (target instanceof LivingEntity livingEntity) {
return -livingEntity.getTotalArmorValue();
}
return 0.0;
}).thenComparing((o, o1) -> {
double health = getEntityHealth((LivingEntity) o);
double health1 = getEntityHealth((LivingEntity) o1);
return Double.compare(health, health1);
}).thenComparing((object, object2) -> {
double d2 = getDistance((LivingEntity) object);
double d3 = getDistance((LivingEntity) object2);
return Double.compare(d2, d3);
}));
}
case "По дистанции" -> {
targets.sort(Comparator.comparingDouble(this::getDistance).thenComparingDouble(this::getEntityHealth));
}
case "По здоровью" -> {
targets.sort(Comparator.comparingDouble(this::getEntityHealth).thenComparingDouble(mc.player::getDistance));
}
}
}
target = targets.get(0);
}
float lastYaw, lastPitch;
private double getDistance(LivingEntity entity) {
return VectorUtils.getVector(entity).length();
}
private void updateRotation(boolean attack, float rotationYawSpeed, float rotationPitchSpeed) {
Vector3d vec = target.getPositionVec().add(0, clamp(mc.player.getPosYEye() - target.getPosY(), 0, target.getHeight() * (mc.player.getDistanceEyePos(target) / attackRange.get())), 0).subtract(mc.player.getEyePosition(1));
isRotated = true;
float yawToTarget = (float) MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(vec.z, vec.x)) - 90);
float pitchToTarget = (float) (-Math.toDegrees(Math.atan2(vec.y, hypot(vec.x, vec.z))));
float yawDelta = (wrapDegrees(yawToTarget - rotateVector.x));
float pitchDelta = (wrapDegrees(pitchToTarget - rotateVector.y));
int roundedYaw = (int) yawDelta;
switch (type.get()) {
case "Плавная" -> {
float clampedYaw = Math.min(Math.max(Math.abs(yawDelta), 0f), rotationYawSpeed);
float clampedPitch = Math.min(Math.max(Math.abs(pitchDelta), 0F), rotationPitchSpeed);
float yaw = rotateVector.x + (yawDelta > 0 ? clampedYaw : -clampedYaw);
float pitch = clamp(rotateVector.y + (pitchDelta > 0 ? clampedPitch : -clampedPitch), -89.0F, 89.0F);
float gcd = SensUtils.getGCDValue();
yaw -= (yaw - rotateVector.x) % gcd;
pitch -= (pitch - rotateVector.y) % gcd;
rotateVector = new Vector2f(yaw, pitch);
lastYaw = clampedYaw;
lastPitch = clampedPitch;
if (options.getValueByName("Коррекция движения").get()) {
mc.player.rotationYawOffset = yaw;
}
}
case "Фантайм" -> {
float clampedYaw = Math.min(Math.max(Math.abs(yawDelta), 0f), rotationYawSpeed);
float clampedPitch = Math.min(Math.max(Math.abs(pitchDelta), 0f), rotationPitchSpeed);
clampedPitch /= 3f;
float yaw = rotateVector.x + (yawDelta > 0 ? clampedYaw : -clampedYaw);
float pitch = clamp(rotateVector.y + (pitchDelta > 0 ? clampedPitch : -clampedPitch), -89.0F, 89.0F);
float gcd = SensUtils.getGCD();
yaw -= (yaw - rotateVector.x) % gcd;
pitch -= (pitch - rotateVector.y) % gcd;
rotateVector = new Vector2f(yaw, pitch);
lastYaw = clampedYaw;
lastPitch = clampedPitch;
if (options.getValueByName("Коррекция движения").get()) {
mc.player.rotationYawOffset = yaw;
}
}
case "ФантаймСнап" -> {
float clampedYaw = Math.min(Math.max(Math.abs(yawDelta), 1.0f), rotationYawSpeed);
float clampedPitch = Math.min(Math.max(Math.abs(pitchDelta), 0f), rotationPitchSpeed);
clampedPitch /= 4f;
AxisAlignedBB targetBoundingBox = target.getBoundingBox();
double reachDistance = 3.2;
if (!isRotated) return;
double playerX = mc.player.getPosX();
double playerY = mc.player.getPosY();
double playerZ = mc.player.getPosZ();
double targetX = targetBoundingBox.minX + (Math.random() * (targetBoundingBox.maxX - targetBoundingBox.minX));
double targetY = targetBoundingBox.minY + (Math.random() * (targetBoundingBox.maxY - targetBoundingBox.minY));
double targetZ = targetBoundingBox.minZ + (Math.random() * (targetBoundingBox.maxZ - targetBoundingBox.minZ));
float yaw = rotateVector.x + (yawDelta > 0 ? clampedYaw : -clampedYaw);
float pitch = clamp(rotateVector.y + (pitchDelta > 0 ? clampedPitch : -clampedPitch), -55F, 55F);
yawToTarget = normalizeAngle(yawToTarget - mc.player.rotationYaw) + mc.player.rotationYaw;
float smoothFactorYaw = 0.613333f;
float smoothFactorPitch = 0.4133333f;
float randomYawMicro = (float) (Math.random() * 0.6 - 0.252);
float randomPitchMicro = (float) (Math.random() * 0.5 - 0.25);
float gcd = SensUtils.getGCD();
yaw -= (yaw - rotateVector.x) % gcd;
pitch -= (pitch - rotateVector.y) % gcd;
mc.player.rotationYaw += (yawToTarget - mc.player.rotationYaw) * smoothFactorYaw;
Vector2f rotation = new Vector2f(mc.player.rotationYaw, mc.player.rotationPitch);
rotateVector = new Vector2f(yaw, pitch);
lastYaw = clampedYaw;
lastPitch = clampedPitch;
if (options.getValueByName("Коррекция движения").get()) {
mc.player.rotationYawOffset = yaw;
}
}
case "ФантаймЛегит" -> {
float clampedYaw = Math.min(Math.max(Math.abs(yawDelta), 0f), rotationYawSpeed);
float clampedPitch = Math.min(Math.max(Math.abs(pitchDelta), 0f), rotationPitchSpeed);
//float gcd = SensUtils.getGCD();
clampedPitch /= 3f;
float yaw = rotateVector.x + (yawDelta > 0 ? clampedYaw : -clampedYaw);
float pitch = clamp(rotateVector.y + (pitchDelta > 0 ? clampedPitch : -clampedPitch), -89.0F, 89.0F);
float gcd = SensUtils.getGCD();
yaw -= (yaw - rotateVector.x) % gcd;
pitch -= (pitch - rotateVector.y) % gcd;
rotateVector = new Vector2f(yaw, pitch);
lastYaw = clampedYaw;
lastPitch = clampedPitch;
if (options.getValueByName("Коррекция движения").get()) {
mc.player.rotationYawOffset = yaw;
}
}
case "Новая" -> {
Entity target = getTarget();
if (target == null) return;
AxisAlignedBB targetBoundingBox = target.getBoundingBox();
double reachDistance = 3.2;
if (!isRotated) return;
double playerX = mc.player.getPosX();
double playerY = mc.player.getPosY();
double playerZ = mc.player.getPosZ();
double targetX = targetBoundingBox.minX + (Math.random() * (targetBoundingBox.maxX - targetBoundingBox.minX));
double targetY = targetBoundingBox.minY + (Math.random() * (targetBoundingBox.maxY - targetBoundingBox.minY));
double targetZ = targetBoundingBox.minZ + (Math.random() * (targetBoundingBox.maxZ - targetBoundingBox.minZ));
Math.sqrt(Math.pow(targetX - playerX, 2) + Math.pow(targetZ - playerZ, 2));
yawToTarget = normalizeAngle(yawToTarget - mc.player.rotationYaw) + mc.player.rotationYaw;
float smoothFactorYaw = 0.613333f;
float smoothFactorPitch = 0.4133333f;
float randomYawMicro = (float) (Math.random() * 0.6 - 0.252);
float randomPitchMicro = (float) (Math.random() * 0.5 - 0.25);
yawToTarget += randomYawMicro;
pitchToTarget += randomPitchMicro;
float randomYawOffset = (float) (Math.random() * 0.223234 - 0.0132233);
randomYawOffset *= 1.2f;
yawToTarget += randomYawOffset;
float randomPitchOffset = (float) (Math.random() * 5.8 - 5.2);
randomPitchOffset *= 0.9f;
pitchToTarget += randomPitchOffset;
mc.player.rotationYaw += (yawToTarget - mc.player.rotationYaw) * smoothFactorYaw;
mc.player.rotationPitch += (pitchToTarget - mc.player.rotationPitch) * smoothFactorPitch;
Vector2f rotation = new Vector2f(mc.player.rotationYaw, mc.player.rotationPitch);
}
}
}
private float normalizeAngle(float v) {
return 0;
}
private void updateAttack() {
selected = MouseUtil.getMouseOver(target, rotateVector.x, rotateVector.y, attackRange.get());
if ((selected == null || selected != target) && !mc.player.isElytraFlying()) {
return;
}
if (mc.player.isBlocking() && options.getValueByName("Отжимать щит").get()) {
mc.playerController.onStoppedUsingItem(mc.player);
}
stopWatch.setLastMS(500);
if (criticals.isState()) {
Criticals.doCrit();
}
mc.playerController.attackEntity(mc.player, target);
mc.player.swingArm(Hand.MAIN_HAND);
if (target instanceof PlayerEntity player && options.getValueByName("Ломать щит").get()) {
breakShieldPlayer(player);
}
}
private boolean shouldPlayerFalling() {
boolean cancelReason = mc.player.isInWater() && mc.player.areEyesInFluid(FluidTags.WATER) || mc.player.isInLava() || mc.player.isOnLadder() || mc.player.isPassenger() || mc.player.abilities.isFlying;
boolean onSpace = mc.player.isOnGround() && !mc.gameSettings.keyBindJump.isKeyDown();
float attackStrength = mc.player.getCooledAttackStrength(options.getValueByName("Синхронизировать ТПС").get()
? Exo.getInstance().getTpsCalc().getAdjustTicks() : 1.5f);
if (attackStrength < 0.93f) {
return false;
}
if (!cancelReason && options.getValueByName("Криты с пробелом").get()) {
return onSpace || !mc.player.isOnGround() && mc.player.fallDistance > 0.00000;
}
if (!cancelReason && options.getValueByName("Только Криты").get()) {
return !mc.player.isOnGround() && mc.player.fallDistance > 0.00000;
}
return true;
}
private boolean isValid(LivingEntity entity) {
if (entity instanceof ClientPlayerEntity) return false;
if (entity.ticksExisted < 0) return false;
if (mc.player.getDistanceEyePos(entity) > (double)attackRange.get() + (double)rotateDistance.get()) return false;;
if (entity instanceof PlayerEntity p) {
if (AntiBot.isBot(entity)) {
return false;
}
if (!targets.getValueByName("Друзья").get() && FriendStorage.isFriend(p.getName().getString())) {
return false;
}
if (p.getName().getString().equalsIgnoreCase(mc.player.getName().getString())) return false;
}
if (entity instanceof PlayerEntity && !targets.getValueByName("Игроки").get()) {
return false;
}
if (entity instanceof PlayerEntity && entity.getTotalArmorValue() == 0 && !targets.getValueByName("Голые").get()) {
return false;
}
if (entity instanceof PlayerEntity && entity.isInvisible() && entity.getTotalArmorValue() == 0 && !targets.getValueByName("Голые невидимки").get()) {
return false;
}
if (entity instanceof PlayerEntity && entity.isInvisible() && !targets.getValueByName("Невидимки").get()) {
return false;
}
if (entity instanceof MonsterEntity && !targets.getValueByName("Мобы").get()) {
return false;
}
if (entity instanceof AnimalEntity && !targets.getValueByName("Животные").get()) {
return false;
}
return !entity.isInvulnerable() && entity.isAlive() && !(entity instanceof ArmorStandEntity);
}
private void breakShieldPlayer(PlayerEntity entity) {
if (entity.isBlocking()) {
int invSlot = InventoryUtil.getInstance().getAxeInInventory(false);
int hotBarSlot = InventoryUtil.getInstance().getAxeInInventory(true);
if (hotBarSlot == -1 && invSlot != -1) {
int bestSlot = InventoryUtil.getInstance().findBestSlotInHotBar();
mc.playerController.windowClick(0, invSlot, 0, ClickType.PICKUP, mc.player);
mc.playerController.windowClick(0, bestSlot + 36, 0, ClickType.PICKUP, mc.player);
mc.player.connection.sendPacket(new CHeldItemChangePacket(bestSlot));
mc.playerController.attackEntity(mc.player, entity);
mc.player.swingArm(Hand.MAIN_HAND);
mc.player.connection.sendPacket(new CHeldItemChangePacket(mc.player.inventory.currentItem));
mc.playerController.windowClick(0, bestSlot + 36, 0, ClickType.PICKUP, mc.player);
mc.playerController.windowClick(0, invSlot, 0, ClickType.PICKUP, mc.player);
}
if (hotBarSlot != -1) {
mc.player.connection.sendPacket(new CHeldItemChangePacket(hotBarSlot));
mc.playerController.attackEntity(mc.player, entity);
mc.player.swingArm(Hand.MAIN_HAND);
mc.player.connection.sendPacket(new CHeldItemChangePacket(mc.player.inventory.currentItem));
}
}
}
private void reset() {
if (options.getValueByName("Коррекция движения").get()) {
mc.player.rotationYawOffset = Integer.MIN_VALUE;
}
rotateVector = new Vector2f(mc.player.rotationYaw, mc.player.rotationPitch);
}
[USER=1367676]@override[/USER]
public void onEnable() {
super.onEnable();
reset();
target = null;
}
[USER=1367676]@override[/USER]
public void onDisable() {
super.onDisable();
reset();
stopWatch.setLastMS(0);
target = null;
}
private double getEntityArmor(PlayerEntity entityPlayer2) {
double d2 = 0.0;
for (int i2 = 0; i2 < 4; ++i2) {
ItemStack is = entityPlayer2.inventory.armorInventory.get(i2);
if (!(is.getItem() instanceof ArmorItem)) continue;
d2 += getProtectionLvl(is);
}
return d2;
}
private double getProtectionLvl(ItemStack stack) {
if (stack.getItem() instanceof ArmorItem i) {
double damageReduceAmount = i.getDamageReduceAmount();
if (stack.isEnchanted()) {
damageReduceAmount += (double) EnchantmentHelper.getEnchantmentLevel(Enchantments.PROTECTION, stack) * 0.25;
}
return damageReduceAmount;
}
return 0;
}
private double getEntityHealth(LivingEntity ent) {
if (ent instanceof PlayerEntity player) {
return (double) (player.getHealth() + player.getAbsorptionAmount()) * (getEntityArmor(player) / 20.0);
}
return ent.getHealth() + ent.getAbsorptionAmount();
}
private float lastYaw2;
private float lastPitch2;
private float animatedYaw;
private float animatedPitch;
private float animation;
private float animationSize;
private final int outlineColor = Color.BLACK.getRGB();
private final int entityColor = Color.RED.getRGB();
@Subscribe
public void onDisplay(EventDisplay e) {
if (mc.player == null || mc.world == null || e.getType() != EventDisplay.Type.POST) {
return;
}
float x = mc.getMainWindow().getScaledWidth() / 2f;
float y = mc.getMainWindow().getScaledHeight() / 2f;
float padding = 5;
switch (mode2.getIndex()) {
case 0 -> {
float size = 5;
int color = ColorUtils.interpolate(HUD.getColor(1), HUD.getColor(1), 1 - animation);
x += animatedYaw;
y += animatedPitch;
float radius = 3 + (animationSize);
if (mc.gameSettings.getPointOfView() == PointOfView.FIRST_PERSON) {
DisplayUtils.drawCircle1(x, y, 0, 360, 100.8f, 1, false);
DisplayUtils.drawCircle1(x, y, 0, animationSize, 100.8f, 1, false);
}
}
case 1 -> {
if (mc.gameSettings.getPointOfView() != PointOfView.FIRST_PERSON) return;
float cooldown = 1 - mc.player.getCooledAttackStrength(0);
float thickness = 1;
float length = 3;
float gap = 2 + 8 * cooldown;
int color = mc.pointedEntity != null ? entityColor : -1;
drawOutlined(x - thickness / 20, y - gap - length, thickness, length, color);
drawOutlined(x - thickness / 20, y + gap, thickness, length, color);
drawOutlined(x - gap - length, y - thickness / 2, length, thickness, color);
drawOutlined(x + gap, y - thickness / 2, length, thickness, color);
}
}
}
private void drawOutlined(
final float x,
final float y,
final float w,
final float h,
final int hex
) {
DisplayUtils.drawRectW(x - 0.5, y - 0.5, w + 1, h + 1, outlineColor);
DisplayUtils.drawRectW(x, y, w, h, hex);
}
}