-
Автор темы
- #1
Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:
- бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
- маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
- приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
- обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.
Спасибо!
Код:
package im.manloxx.functions.impl.combat;
import com.google.common.eventbus.Subscribe;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import im.manloxx.Manloxx;
import im.manloxx.command.friends.FriendStorage;
import im.manloxx.events.*;
import im.manloxx.functions.api.Category;
import im.manloxx.functions.api.Function;
import im.manloxx.functions.api.FunctionRegister;
import im.manloxx.functions.impl.render.HUD;
import im.manloxx.functions.settings.impl.BooleanSetting;
import im.manloxx.functions.settings.impl.ModeListSetting;
import im.manloxx.functions.settings.impl.ModeSetting;
import im.manloxx.functions.settings.impl.SliderSetting;
import im.manloxx.utils.animations.Animation;
import im.manloxx.utils.animations.Direction;
import im.manloxx.utils.animations.impl.DecelerateAnimation;
import im.manloxx.utils.math.MathUtil;
import im.manloxx.utils.math.SensUtils;
import im.manloxx.utils.math.StopWatch;
import im.manloxx.utils.math.Vector4i;
import im.manloxx.utils.player.InventoryUtil;
import im.manloxx.utils.player.MouseUtil;
import im.manloxx.utils.player.MoveUtils;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import im.manloxx.utils.projections.ProjectionUtil;
import im.manloxx.utils.render.ColorUtils;
import im.manloxx.utils.render.DisplayUtils;
import lombok.Getter;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.player.ClientPlayerEntity;
import net.minecraft.client.entity.player.RemoteClientPlayerEntity;
import net.minecraft.client.renderer.ActiveRenderInfo;
import net.minecraft.client.renderer.entity.EntityRendererManager;
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.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.UseAction;
import net.minecraft.network.play.client.CHeldItemChangePacket;
import net.minecraft.tags.FluidTags;
import net.minecraft.util.Hand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.RayTraceContext;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.RayTraceContext.BlockMode;
import net.minecraft.util.math.RayTraceContext.FluidMode;
import net.minecraft.util.math.RayTraceResult.Type;
import net.minecraft.util.math.vector.Quaternion;
import net.minecraft.util.math.vector.Vector2f;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.util.math.vector.Vector3f;
import net.optifine.shaders.Shaders;
import org.lwjgl.opengl.GL11;
import static com.mojang.blaze3d.platform.GlStateManager.GL_QUADS;
import static com.mojang.blaze3d.platform.GlStateManager.depthMask;
import static java.lang.Math.*;
import static net.minecraft.client.renderer.vertex.DefaultVertexFormats.POSITION_COLOR_TEX;
import static net.minecraft.util.math.MathHelper.clamp;
import static net.minecraft.util.math.MathHelper.wrapDegrees;
@FunctionRegister(
name = "Aura",
type = Category.Combat
)
public class KillAura extends Function {
private final ModeSetting type = new ModeSetting("Тип", "HolyWorld", "HolyWorld","FunTime","ReallyWorld","HvH");
private final ModeSetting modes = new ModeSetting("TargetEsp", "Клиент", "Клиент","Души");
public SliderSetting speed = new SliderSetting("Скорость", 2.0F, 0.7F, 9.0F, 1.0F);
public SliderSetting size = new SliderSetting("Размер", 75.0F, 5.0F, 140.0F, 1.0F);
public SliderSetting bright = new SliderSetting("Яркость", 255.0F, 1.0F, 255.0F, 1.0F);
private final SliderSetting attackSpeed = new SliderSetting("Скорость атаки", 100f, 50f, 1000f, 1f).setVisible(() -> type.get() != "Резкая").setVisible(() -> type.get() != "HvH Experimental");
private final SliderSetting attackRange = new SliderSetting("Дистанция атаки", 3.0F, 3.0F, 6.0F, 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));
@Getter
final ModeListSetting options = new ModeListSetting("Опции",
new BooleanSetting("Только криты", true),
new BooleanSetting("Ломать щит", true),
new BooleanSetting("Отжимать щит", true),
new BooleanSetting("Ускорять ротацию при атаке", false),
new BooleanSetting("Синхронизировать атаку с ТПС", false),
new BooleanSetting("Фокусировать одну цель", true),
new BooleanSetting("Коррекция движения", true),
new BooleanSetting("Резольвер", true),
new BooleanSetting("Бить когда ешь", true));
final ModeSetting correctionType = new ModeSetting("Тип коррекции", "Сфокусированный", new String[]{"Сфокусированный", "Незаметная"});
private final BooleanSetting checkWallObstruction = new BooleanSetting("не бить через стену", true);
private final StopWatch stopWatch = new StopWatch();
private Vector2f rotateVector = new Vector2f(0.0F, 0.0F);
private LivingEntity target;
private Entity selected;
private LivingEntity currentTarget;
int ticks = 0;
boolean isRotated;
boolean blblbl = true;
public static long startTime = System.currentTimeMillis();
float lastYaw;
float lastPitch;
float yaw;
float pitch;
StopWatch yawUpdate = new StopWatch();
StopWatch pitchUpdate = new StopWatch();
boolean attackEnt = false;
private final Animation alpha = new DecelerateAnimation(600, 255.0);
public KillAura() {
addSettings(type, modes, attackRange, targets, options, correctionType, checkWallObstruction);
}
@Subscribe
public void onInput(EventInput eventInput) {
if ((Boolean) this.options.getValueByName("Коррекция движения").get() && this.correctionType.is("Незаметная") && this.target != null && mc.player != null) {
MoveUtils.fixMovement(eventInput, this.rotateVector.x);
}
}
@Subscribe
public void onUpdate(EventUpdate e) {
if (options.getValueByName("Резольвер").get()) {
resolvePlayers();
releaseResolver();
}
blblbl = type.get().equalsIgnoreCase("Snap");
if ((Boolean) this.options.getValueByName("Фокусировать одну цель").get() && (this.target == null || !this.isValid(this.target)) || !(Boolean) this.options.getValueByName("Фокусировать одну цель").get()) {
this.updateTarget();
}
if (this.target != null) {
this.isRotated = false;
if (this.shouldPlayerFalling() && this.stopWatch.hasTimeElapsed()) {
this.updateAttack();
this.ticks = 2;
}
if (this.type.is("ReallyWorld")) {
if (this.ticks > 0) {
this.updateRotation(true, 180.0F, 90.0F);
int var3 = this.ticks;
this.ticks = var3 - 1;
} else {
this.reset();
}
} else if (!this.isRotated) {
this.updateRotation(false, 80.0F, 35.0F);
} else {
this.stopWatch.setLastMS(0L);
this.reset();
}
}
}
@Subscribe
private void onWalking(EventMotion e) {
if (this.target != null) {
float yaw = this.rotateVector.x;
float pitch = this.rotateVector.y;
e.setYaw(yaw);
e.setPitch(pitch);
mc.player.rotationYawHead = yaw;
mc.player.renderYawOffset = yaw;
mc.player.rotationPitchHead = pitch;
}
}
private void updateTarget() {
List<LivingEntity> targets = new ArrayList();
Iterator var2 = mc.world.getAllEntities().iterator();
while (var2.hasNext()) {
Entity entity = (Entity) var2.next();
if (entity instanceof LivingEntity living) {
if (this.isValid(living)) {
targets.add(living);
}
}
}
if (targets.isEmpty()) {
this.target = null;
} else if (targets.size() == 1) {
this.target = (LivingEntity) targets.get(0);
} else {
targets.sort(Comparator.comparingDouble((object) -> {
if (object instanceof PlayerEntity player) {
return -this.getEntityArmor(player);
} else if (object instanceof LivingEntity base) {
return (double) (-base.getTotalArmorValue());
} else {
return 0.0;
}
}).thenComparing((object, object2) -> {
double d2 = this.getEntityHealth((LivingEntity) object);
double d3 = this.getEntityHealth((LivingEntity) object2);
return Double.compare(d2, d3);
}).thenComparing((object, object2) -> {
double d2 = (double) mc.player.getDistance((LivingEntity) object);
double d3 = (double) mc.player.getDistance((LivingEntity) object2);
return Double.compare(d2, d3);
}));
this.target = (LivingEntity) targets.get(0);
}
}
private void updateRotation(boolean attack, float rotationYawSpeed, float rotationPitchSpeed) {
Vector3d vec = this.target.getPositionVec().add(0.0, clamp(mc.player.getPosYEye() - this.target.getPosY(), 0.0, (double) this.target.getHeight() * (mc.player.getDistanceEyePos(this.target) / (double) (Float) this.attackRange.get())), 0.0).subtract(mc.player.getEyePosition(1.0F));
this.isRotated = true;
float yawToTarget = (float) wrapDegrees(toDegrees(atan2(vec.z, vec.x)) - 90);
float pitchToTarget = (float) (-toDegrees(atan2(vec.y, hypot(vec.x, vec.z))));
float yawDelta = (wrapDegrees(yawToTarget - rotateVector.x));
float pitchDelta = (wrapDegrees(pitchToTarget - rotateVector.y));
int roundYawDelta = (int) abs(yawDelta);
int roundPitchDelta = (int) abs(pitchDelta);
int roundedYaw = (int) yawDelta;
switch (type.get()) {
case "FunTime" -> {
double yawSpeed, pitchSpeed;
if (MouseUtil.getMouseOver(target, rotateVector.x, rotateVector.y, attackDistance()) != null) {
yawSpeed = MathUtil.randomWithUpdate(5, 25, 200, yawUpdate);
pitchSpeed = 0;
} else {
yawSpeed = MathUtil.randomWithUpdate(20, 115, 100, yawUpdate);
pitchSpeed = MathUtil.randomWithUpdate(5, 15, 40, pitchUpdate);
}
float clampedYaw = (float) Math.min(Math.max(roundYawDelta, 0f), yawSpeed);
float clampedPitch = (float) Math.min(Math.max(roundPitchDelta * 0.35f, 0f), pitchSpeed);
yaw = rotateVector.x + (yawDelta > 0 ? clampedYaw : -clampedYaw);
pitch = clamp(rotateVector.y + (pitchDelta > 0 ? clampedPitch : -clampedPitch), -180, 180);
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()) {
Minecraft.player.rotationYawOffset = yaw;
}
}
case "HolyWorld" -> {
float clampedYaw = min(max(abs(yawDelta), 1.2f), rotationYawSpeed);
float clampedPitch = min(max(abs(pitchDelta), 5.4F), rotationPitchSpeed);
if (abs(clampedYaw - this.lastYaw) <= 2.0f) {
clampedYaw = this.lastYaw + 2.3f;
}
clampedYaw = (float) min(max(roundYawDelta, 0.6f), rotationYawSpeed);
clampedPitch = (float) min(max(roundPitchDelta * 0.13f, 0.86f), 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 "Snap" -> {
float yaw = rotateVector.x + roundedYaw;
float pitch = clamp(rotateVector.y + pitchDelta, -90, 90);
float gcd = SensUtils.getGCDValue();
yaw -= (yaw - rotateVector.x) % gcd;
pitch -= (pitch - rotateVector.y) % gcd;
rotateVector = new Vector2f(yaw, pitch);
if (options.getValueByName("Коррекция движения").get()) {
mc.player.rotationYawOffset = yaw;
}
}
case "HvH" -> {
double yawSpeed, pitchSpeed;
if (MouseUtil.getMouseOver(target, rotateVector.x, rotateVector.y, attackDistance()) != null) {
yawSpeed = MathUtil.randomWithUpdate(5, 25, 200, yawUpdate);
pitchSpeed = 0;
} else {
yawSpeed = MathUtil.randomWithUpdate(19, 113, 60, yawUpdate);
pitchSpeed = MathUtil.randomWithUpdate(2, 17, 40, pitchUpdate);
}
float clampedYaw = (float) min(max(roundYawDelta, 1.0f), yawSpeed);
float clampedPitch = (float) min(max(roundPitchDelta * 0.33f, 1.0f), pitchSpeed);
yaw = rotateVector.x + (yawDelta > 0 ? clampedYaw : -clampedYaw);
pitch = clamp(rotateVector.y + (pitchDelta > 0 ? clampedPitch : -clampedPitch), -90, 80);
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 "переделать!!!" -> {
double yawSpeed, pitchSpeed;
if (MouseUtil.getMouseOver(target, rotateVector.x, rotateVector.y, attackDistance()) != null) {
yawSpeed = MathUtil.randomWithUpdate(12, 25, 5, yawUpdate);
pitchSpeed = 0;
} else {
// TODO: if the target under the crosshair is null
yawSpeed = MathUtil.randomWithUpdate(19, 113, 105, yawUpdate);
pitchSpeed = MathUtil.randomWithUpdate(2, 17, 40, pitchUpdate);
}
float clampedYaw = (float) Math.min(Math.max(roundYawDelta, 0.7f), yawSpeed);
float clampedPitch = (float) Math.min(Math.max(roundPitchDelta * 0.37f, 1.0f), pitchSpeed);
yaw = rotateVector.x + (yawDelta > 0 ? clampedYaw : -clampedYaw);
pitch = clamp(rotateVector.y + (pitchDelta > 0 ? clampedPitch : -clampedPitch), -90, 90);
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 "ReallyWorld" -> {
float yawStep = rotationYawSpeed * 0.36f;
float pitchStep = rotationPitchSpeed * 0.05f;
if (attack && selected != target && options.getValueByName("Ускорять ротацию при атаке").get()) {
pitchStep = rotationPitchSpeed * 0.15f;
}
if (abs(yawDelta) > yawStep) {
rotateVector.x += yawDelta > 0 ? yawStep : -yawStep;
} else {
rotateVector.x = yawToTarget;
}
if (abs(pitchDelta) > pitchStep) {
rotateVector.y += pitchDelta > 0 ? pitchStep : -pitchStep;
} else {
rotateVector.y = pitchToTarget;
}
float gcd = SensUtils.getGCDValue();
rotateVector.x -= (rotateVector.x - mc.player.rotationYaw) % gcd;
rotateVector.y -= (rotateVector.y - mc.player.rotationPitch) % gcd;
if (options.getValueByName("Коррекция движения").get()) {
mc.player.rotationYawOffset = rotateVector.x;
}
}
}
}
private void updateAttack() {
if (!(Boolean)this.checkWallObstruction.get() || this.canSeeThroughWall(this.target)) {
this.selected = MouseUtil.getMouseOver(this.target, this.rotateVector.x, this.rotateVector.y, (double)(Float)this.attackRange.get());
if (options.getValueByName("Ускорять ротацию при атаке").get()) {
this.updateRotation(true, 60.0F, 35.0F);
}
if (this.selected != null && this.selected == this.target || mc.player.isElytraFlying()) {
if (mc.player.isBlocking() && options.getValueByName("Отжимать щит").get()) {
mc.playerController.onStoppedUsingItem(mc.player);
}
if (!options.getValueByName("Бить когда ешь").get()) {
if (mc.player.isHandActive()) {
ItemStack activeItemStack = mc.player.getActiveItemStack();
if (activeItemStack.getUseAction() == UseAction.EAT) {
return;
}
}
}
this.stopWatch.setLastMS(500L);
mc.playerController.attackEntity(mc.player, this.target);
mc.player.swingArm(Hand.MAIN_HAND);
LivingEntity var2 = this.target;
if (var2 instanceof PlayerEntity) {
PlayerEntity player = (PlayerEntity)var2;
if ((Boolean)this.options.getValueByName("Ломать щит").get()) {
this.breakShieldPlayer(player);
}
}
}
}
}
public float attackDistance() {
if (!mc.player.isSwimming()) {
return 3.6f;
} else {
return 3.0f;
}
}
public void resolvePlayers() {
for (PlayerEntity player : mc.world.getPlayers()) {
if (player instanceof RemoteClientPlayerEntity) {
((RemoteClientPlayerEntity) player).resolve();
}
}
}
public void releaseResolver() {
for (PlayerEntity player : mc.world.getPlayers()) {
if (player instanceof RemoteClientPlayerEntity) {
((RemoteClientPlayerEntity) player).releaseResolver();
}
}
}
private boolean canSeeThroughWall(Entity entity) {
RayTraceResult result = mc.world.rayTraceBlocks(new RayTraceContext(mc.player.getEyePosition(1.0F), entity.getEyePosition(1.0F), BlockMode.COLLIDER, FluidMode.NONE, mc.player));
return result == null || result.getType() == Type.MISS;
}
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;
float attackStrength = mc.player.getCooledAttackStrength((Boolean)this.options.getValueByName("Синхронизировать атаку с ТПС").get() ? Manloxx.getInstance().getTpsCalc().getAdjustTicks() : 1.5F);
if (attackStrength < 0.92F) {
return false;
} if (!cancelReason && options.getValueByName("Только криты").get()) {
return !mc.player.isOnGround() && mc.player.fallDistance > 0.0F;
} else {
return true;
}
}
private boolean isValid(LivingEntity entity) {
if (entity instanceof ClientPlayerEntity) return false;
if (entity.ticksExisted < 3) return false;
if (mc.player.getDistanceEyePos(entity) > attackRange.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));
}
}
}
@Subscribe
private void setOptions(WorldEvent e) {
if (modes.is("Сканер")) {
KillAura killAura = Manloxx.getInstance().getFunctionRegistry().getKillAura();
if (killAura.isState() && killAura.getTarget() != null) {
MatrixStack ms = new MatrixStack();
ms.push();
RenderSystem.pushMatrix();
RenderSystem.disableLighting();
depthMask(false);
RenderSystem.enableBlend();
RenderSystem.shadeModel(7425);
RenderSystem.disableCull();
RenderSystem.disableAlphaTest();
RenderSystem.blendFuncSeparate(770, 1, 0, 1);
double x = killAura.getTarget().getPosX();
double y = killAura.getTarget().getPosY() + killAura.getTarget().getHeight() / 2f;
double z = killAura.getTarget().getPosZ();
double radius = 0.65f;
float speed = 12;
float size = 0.5f;
double distance = 155;
int lenght = 155;
int maxAlpha = 255;
int alphaFactor = 0;
ActiveRenderInfo camera = mc.getRenderManager().info;
ms.translate(-mc.getRenderManager().info.getProjectedView().getX(),
-mc.getRenderManager().info.getProjectedView().getY(),
-mc.getRenderManager().info.getProjectedView().getZ());
Vector3d interpolated = MathUtil.interpolate(killAura.getTarget().getPositionVec(), new Vector3d(killAura.getTarget().lastTickPosX, killAura.getTarget().lastTickPosY, killAura.getTarget().lastTickPosZ), e.getPartialTicks());
interpolated.y += 0.8f;
ms.translate(interpolated.x + 0.2f, interpolated.y + 0.5f, interpolated.z);
mc.getTextureManager().bindTexture(new ResourceLocation("expensive/images/glow.png"));
for (int j = 0; j < 1; j++) { // Добавляем три независимых эффекта
for (int i = 0; i < lenght; i++) {
Quaternion r = camera.getRotation().copy();
buffer.begin(GL_QUADS, POSITION_COLOR_TEX);
long lastTime = 0;
double angle = 0.05f * (System.currentTimeMillis() - lastTime - (i * distance)) / (speed);
double s = sin(angle + j * (PI / 1.5)) * radius;
double c = cos(angle + j * (PI / 1.5)) * radius;
double yOffset = sin(System.currentTimeMillis() * 0.002 + j) * 0.5;
ms.translate(0, yOffset, 0);
ms.translate(s, 0, -c);
ms.translate(-size / 2f, -size / 2f, 0);
ms.rotate(r);
ms.translate(size / 2f, size / 2f, 0);
int color = ColorUtils.getColor(i);
int alpha = clamp(maxAlpha - (i * alphaFactor), 0, maxAlpha);
buffer.pos(ms.getLast().getMatrix(), 0, -size, 0).color(DisplayUtils.reAlphaInt(color, alpha)).tex(0, 0).endVertex();
buffer.pos(ms.getLast().getMatrix(), -size, -size, 0).color(DisplayUtils.reAlphaInt(color, alpha)).tex(0, 1).endVertex();
buffer.pos(ms.getLast().getMatrix(), -size, 0, 0).color(DisplayUtils.reAlphaInt(color, alpha)).tex(1, 1).endVertex();
buffer.pos(ms.getLast().getMatrix(), 0, 0, 0).color(DisplayUtils.reAlphaInt(color, alpha)).tex(1, 0).endVertex();
tessellator.draw();
ms.translate(-size / 2f, -size / 2f, 0);
r.conjugate();
ms.rotate(r);
ms.translate(size / 2f, size / 2f, 0);
ms.translate(-s, 0, c);
ms.translate(0, -yOffset, 0);
}
}
RenderSystem.defaultBlendFunc();
RenderSystem.disableBlend();
RenderSystem.enableCull();
RenderSystem.enableAlphaTest();
depthMask(true);
RenderSystem.popMatrix();
ms.pop();
}
}
}
@Subscribe
private void onDisplay(EventDisplay e) {
if (this.modes.is("Клиент")) {
if (e.getType() != EventDisplay.Type.PRE) {
return;
}
if (this.currentTarget != null && this.currentTarget != mc.player) {
double sin = sin(System.currentTimeMillis() / 800.0);
float size = 90.0F;
Vector3d interpolated = currentTarget.getPositon(e.getPartialTicks());
Vector2f pos = ProjectionUtil.project(interpolated.x, interpolated.y + currentTarget.getHeight() / 2f, interpolated.z);
GlStateManager.pushMatrix();
GlStateManager.translatef(pos.x, pos.y, 0);
GlStateManager.rotatef((float) sin * 200, 0, 0, 1);
GlStateManager.translatef(-pos.x, -pos.y, 0);
if (pos != null) {
DisplayUtils.drawImageAlpha(new ResourceLocation("expensive/images/target2.png"), pos.x - size / 2f, pos.y - size / 2f, size/1, size/1, new Vector4i(ColorUtils.setAlpha(HUD.getColor(0, 1), (int) this.alpha.getOutput()),
ColorUtils.setAlpha(HUD.getColor(10, 1), (int) this.alpha.getOutput()),
ColorUtils.setAlpha(HUD.getColor(120, 1), (int) this.alpha.getOutput()),
ColorUtils.setAlpha(HUD.getColor(255, 1), (int) this.alpha.getOutput())
));
GlStateManager.popMatrix();
}
}
}
}
@Subscribe
private void onEvent(EventUpdate eventUpdate) {
boolean bl = Manloxx.getInstance().getFunctionRegistry().getKillAura().isState();
if (this.target != null) {
this.currentTarget = this.target;
}
this.alpha.setDirection(bl && this.target != null ? Direction.FORWARDS : Direction.BACKWARDS);
}
@Subscribe
private void onDispla(EventDisplay e) {
if (this.modes.is("Ромб")) {
if (e.getType() != EventDisplay.Type.PRE) {
return;
}
if (this.currentTarget != null && this.currentTarget != mc.player) {
double sin = sin(System.currentTimeMillis() / 800.0);
float size = 90.0F;
Vector3d interpolated = currentTarget.getPositon(e.getPartialTicks());
Vector2f pos = ProjectionUtil.project(interpolated.x, interpolated.y + currentTarget.getHeight() / 2f, interpolated.z);
GlStateManager.pushMatrix();
GlStateManager.translatef(pos.x, pos.y, 0);
GlStateManager.rotatef((float) sin * 200, 0, 0, 1);
GlStateManager.translatef(-pos.x, -pos.y, 0);
if (pos != null) {
DisplayUtils.drawImageAlpha(new ResourceLocation("expensive/images/marker.png"), pos.x - size / 2f, pos.y - size / 2f, size/1, size/1, new Vector4i(ColorUtils.setAlpha(HUD.getColor(0, 1), (int) this.alpha.getOutput()),
ColorUtils.setAlpha(HUD.getColor(10, 1), (int) this.alpha.getOutput()),
ColorUtils.setAlpha(HUD.getColor(120, 1), (int) this.alpha.getOutput()),
ColorUtils.setAlpha(HUD.getColor(255, 1), (int) this.alpha.getOutput())
));
GlStateManager.popMatrix();
}
}
}
}
@Subscribe
private void onj(EventUpdate eventUpdate) {
boolean bl = Manloxx.getInstance().getFunctionRegistry().getKillAura().isState();
if (this.target != null) {
this.currentTarget = this.target;
}
this.alpha.setDirection(bl && this.target != null ? Direction.FORWARDS : Direction.BACKWARDS);
}
@Subscribe
private void onWorldEvent(WorldEvent e) {
if (this.modes.is("Призраки")) {
renderGhostEffect(e);
} else if (this.modes.is("Души")) {
renderGhostEffect2(e);
}
}
private void renderGhostEffect(WorldEvent e) {
MatrixStack stack = new MatrixStack();
EntityRendererManager rm = mc.getRenderManager();
float c = (float)((double)((float)(System.currentTimeMillis() - startTime) / 1500.0F) + sin((double)((float)(System.currentTimeMillis() - startTime) / 1500.0F)) / 10.0);
double x = this.target.lastTickPosX + (this.target.getPosX() - this.target.lastTickPosX) * (double)e.getPartialTicks() - rm.info.getProjectedView().getX();
double y = this.target.lastTickPosY + (this.target.getPosY() - this.target.lastTickPosY) * (double)e.getPartialTicks() - rm.info.getProjectedView().getY();
double z = this.target.lastTickPosZ + (this.target.getPosZ() - this.target.lastTickPosZ) * (double)e.getPartialTicks() - rm.info.getProjectedView().getZ();
float alpha = Shaders.shaderPackLoaded ? 1.6F : 1.4F;
alpha *= 0.6F;
float pl = 0.0F;
boolean fa = true;
for (int b = 0; b < 3; ++b) {
for (float i = c * 360.0F; i < c * 360.0F + 170.0F; i += 2.0F) {
float cur = i;
float min = c * 360.0F;
float max = c * 360.0F + 170.0F;
float dc = MathHelper.normalize(cur, c * 360.0F - 145.0F, max);
float degrees = i;
int color = ColorUtils.getColor(0);
int color2 = ColorUtils.getColor(90);
float rf = 0.5F;
double radians = toRadians((double)degrees);
double plY = (double)pl + sin(radians * 1.4000000476837158) * 0.50000000149011612;
stack.push();
stack.translate(x, y, z);
stack.rotate(Vector3f.YP.rotationDegrees(-rm.info.getYaw()));
RenderSystem.depthMask(false);
float q = (!fa ? 0.15F : 0.15F) * (max(fa ? 0.15F : 0.15F, fa ? dc : (1.0F - -(0.2F - dc)) / 1.0F) + 0.32F);
float w = q * (1.5F + (0.5F - alpha) * 2.0F);
DisplayUtils.drawtargetespimage(stack, new ResourceLocation("expensive/images/glow.png"), cos(radians) * (double)rf - (double)(w / 2.0F), plY + 1.5 - 1.5, sin(radians) * (double)rf - (double)(w / 2.0F), (double)w, (double)w, color, color2, color2, color);
GL11.glEnable(2829);
RenderSystem.depthMask(true);
stack.pop();
}
c *= -0.92F;
fa = !fa;
pl += 0.21F;
}
}
private void renderGhostEffect2(WorldEvent e) {
MatrixStack stack = new MatrixStack();
EntityRendererManager rm = mc.getRenderManager();
float c = (float) ((double) ((float) (System.currentTimeMillis() - startTime) / 1350.0F) + sin((double) ((float) (System.currentTimeMillis() - startTime) / 1350.0F)) / 10.0);
double x = this.target.lastTickPosX + (this.target.getPosX() - this.target.lastTickPosX) * (double) e.getPartialTicks() - rm.info.getProjectedView().getX();
double y = this.target.lastTickPosY + (this.target.getPosY() - this.target.lastTickPosY) * (double) e.getPartialTicks() - rm.info.getProjectedView().getY();
double z = this.target.lastTickPosZ + (this.target.getPosZ() - this.target.lastTickPosZ) * (double) e.getPartialTicks() - rm.info.getProjectedView().getZ();
float alpha = Shaders.shaderPackLoaded ? 0.8F : 1.5F;
alpha *= 0.5F;
float pl = 0.0F;
boolean fa = true;
// Первый призрак
for (int b = 0; b < 3; ++b) {
for (float i = c * 360.0F; i < c * 360.0F + 170.0F; i += 2.0F) {
float cur = i;
float min = c * 360.0F;
float max = c * 360.0F + 170.0F;
float dc = MathHelper.normalize(cur, c * 360.0F - 145.0F, max);
float degrees = i;
int color = ColorUtils.getColor(50);
int color2 = ColorUtils.getColor(140);
float rf = 0.65F; // Уменьшенная длина
double radians = toRadians((double) degrees);
double plY = (double) pl + sin(radians * 1.2000000476837158) * 0.00000000149011612;
stack.push();
stack.translate(x, y, z);
stack.rotate(Vector3f.YP.rotationDegrees(-rm.info.getYaw()));
RenderSystem.depthMask(false);
float q = (!fa ? 0.15F : 0.15F) * (max(fa ? 0.15F : 0.15F, fa ? dc : (1.0F - -(0.4F - dc)) / 1.0F) + 0.45F);
float w = q * (2.0F + (0.5F - alpha) * 2.0F); // Уменьшенная длина
DisplayUtils.drawtargetespimage(stack, new ResourceLocation("expensive/images/glow.png"), cos(radians) * (double) rf - (double) (w / 2.0F), plY + 1.0 - 0.7, sin(radians) * (double) rf - (double) (w / 2.0F), (double) w, (double) w, color, color2, color2, color);
GL11.glEnable(2929);
RenderSystem.depthMask(true);
stack.pop();
}
c *= 1.25F;
fa = !fa;
pl += 0.65F;
}
}
private void reset() {
if ((Boolean)this.options.getValueByName("Коррекция движения").get()) {
mc.player.rotationYawOffset = -2.14748365E9F;
}
this.rotateVector = new Vector2f(mc.player.rotationYaw, mc.player.rotationPitch);
}
public boolean onEnable() {
super.onEnable();
this.reset();
this.target = null;
return false;
}
public void onDisable() {
super.onDisable();
this.reset();
this.stopWatch.setLastMS(0L);
this.target = null;
}
private double getEntityArmor(PlayerEntity entityPlayer2) {
double d2 = 0.0;
for(int i2 = 0; i2 < 4; ++i2) {
ItemStack is = (ItemStack)entityPlayer2.inventory.armorInventory.get(i2);
if (is.getItem() instanceof ArmorItem) {
d2 += this.getProtectionLvl(is);
}
}
return d2;
}
private double getProtectionLvl(ItemStack stack) {
Item var3 = stack.getItem();
if (var3 instanceof ArmorItem i) {
double damageReduceAmount = (double)i.getDamageReduceAmount();
if (stack.isEnchanted()) {
damageReduceAmount += (double)EnchantmentHelper.getEnchantmentLevel(Enchantments.PROTECTION, stack) * 0.25;
}
return damageReduceAmount;
} else {
return 0.0;
}
}
private double getEntityHealth(LivingEntity ent) {
if (ent instanceof PlayerEntity player) {
return (double)(player.getHealth() + player.getAbsorptionAmount()) * (this.getEntityArmor(player) / 20.0);
} else {
return (double)(ent.getHealth() + ent.getAbsorptionAmount());
}
}
public ModeSetting getType() {
return this.type;
}
public ModeListSetting getOptions() {
return this.options;
}
public StopWatch getStopWatch() {
return this.stopWatch;
}
public LivingEntity getTarget() {
return this.target;
}
}