-
Автор темы
- #1
Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:
- бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
- маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
- приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
- обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.
Спасибо!
Код:
package ru.shield.modules.impl.combat;
import com.mojang.blaze3d.systems.RenderSystem;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
import net.minecraft.client.renderer.WorldVertexBufferUploader;
import net.minecraft.client.renderer.entity.EntityRendererManager;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.item.ArmorStandEntity;
import net.minecraft.entity.merchant.villager.VillagerEntity;
import net.minecraft.entity.monster.MonsterEntity;
import net.minecraft.entity.monster.SlimeEntity;
import net.minecraft.entity.passive.AnimalEntity;
import net.minecraft.entity.passive.WaterMobEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.network.play.client.CEntityActionPacket;
import net.minecraft.network.play.client.CHeldItemChangePacket;
import net.minecraft.network.play.client.CEntityActionPacket.Action;
import net.minecraft.potion.Effects;
import net.minecraft.tags.FluidTags;
import net.minecraft.util.Hand;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector3d;
import org.lwjgl.opengl.GL11;
import ru.shield.events.Event;
import ru.shield.events.impl.player.EventInput;
import ru.shield.events.impl.player.EventInteractEntity;
import ru.shield.events.impl.player.EventMotion;
import ru.shield.events.impl.player.EventUpdate;
import ru.shield.events.impl.player.EventWorldChange;
import ru.shield.events.impl.render.EventRender;
import ru.shield.managment.Managment;
import ru.shield.modules.Function;
import ru.shield.modules.FunctionAnnotation;
import ru.shield.modules.Type;
import ru.shield.modules.settings.Setting;
import ru.shield.modules.settings.imp.BooleanOption;
import ru.shield.modules.settings.imp.ModeSetting;
import ru.shield.modules.settings.imp.MultiBoxSetting;
import ru.shield.modules.settings.imp.SliderSetting;
import ru.shield.util.math.GCDUtil;
import ru.shield.util.math.RayTraceUtil;
import ru.shield.util.movement.MoveUtil;
import ru.shield.util.render.RenderUtil.IntColor;
import ru.shield.util.world.InventoryUtil;
@FunctionAnnotation(
name = "Legit Aura",
type = Type.Combat
)
public class AuraNew extends Function {
private final ModeSetting mode = new ModeSetting("Режим ротации", "Снапы", new String[]{"Обычная", "Снапы"});
private final SliderSetting range = new SliderSetting("Дистанция", 3.0F, 3.0F, 6.0F, 0.05F);
private final SliderSetting preRange = (new SliderSetting("Дистанция ротации", 0.5F, 0.0F, 3.0F, 0.05F)).setVisible(() -> {
return this.mode.is("Обычная");
});
private final MultiBoxSetting targets = new MultiBoxSetting("Цели", new BooleanOption[]{new BooleanOption("Игроки", true), new BooleanOption("Животные", false), new BooleanOption("Монстры", false)});
private final MultiBoxSetting ignore = new MultiBoxSetting("Игнорировать", new BooleanOption[]{new BooleanOption("Друзей", true), new BooleanOption("Невидимых", false), new BooleanOption("Голых", false), new BooleanOption("Ботов", true)});
private final ModeSetting sort = new ModeSetting("Сортировать", "По дистанции", new String[]{"По дистанции", "По здоровью", "По полю зрения"});
public final MultiBoxSetting settings = new MultiBoxSetting("Настройки", new BooleanOption[]{new BooleanOption("Только критами", true), new BooleanOption("Коррекция движения", true), new BooleanOption("Не бить при использовании", false), new BooleanOption("Отжимать щит", true), new BooleanOption("Ломать щит", true)});
private final BooleanOption space = (new BooleanOption("Криты только с пробелом", false)).setVisible(() -> {
return this.settings.get(0);
});
private final BooleanOption silent = (new BooleanOption("Сайлент коррекция", true)).setVisible(() -> {
return this.settings.get(1);
});
private long cpsLimit = 0L;
public static LivingEntity target;
float rotYaw;
float rotPitch;
int ticks;
public AuraNew() {
this.addSettings(new Setting[]{this.range, this.preRange, this.mode, this.targets, this.ignore, this.sort, this.settings, this.space, this.silent});
}
public void onEvent(Event event) {
if (mc.player != null && mc.world != null) {
if (event instanceof EventInteractEntity) {
EventInteractEntity entity = (EventInteractEntity)event;
if (target != null) {
entity.setCancel(true);
}
}
if (event instanceof EventInput) {
EventInput e = (EventInput)event;
if (this.settings.get(1) && this.silent.get()) {
MoveUtil.fixMovement(e, this.rotYaw);
}
}
if (event instanceof EventUpdate) {
target = this.findTarget();
if (target == null) {
this.reset();
return;
}
switch (this.mode.getIndex()) {
case 0:
this.updateRotation(0.5F);
if (this.canAttack() && RayTraceUtil.getMouseOver(target, this.rotYaw, this.rotPitch, (double)this.range.getValue().floatValue()) == target) {
this.updateAttack(target);
}
break;
case 1:
if (this.canAttack()) {
this.updateAttack(target);
this.ticks = 3;
}
if (this.ticks > 0) {
this.updateRotation(1.0F);
--this.ticks;
} else {
this.rotYaw = mc.player.rotationYaw;
this.rotPitch = mc.player.rotationPitch;
}
}
}
if (event instanceof EventMotion) {
EventMotion e = (EventMotion)event;
if (target == null) {
return;
}
e.setYaw(this.rotYaw);
e.setPitch(this.rotPitch);
this.updateClientRotation(this.rotYaw, this.rotPitch);
}
if (event instanceof EventWorldChange) {
this.reset();
}
if (event instanceof EventRender) {
EventRender e = (EventRender)event;
if (e.isRender3D() && target != null) {
}
}
}
}
private void updateRotation(float speed) {
if (!this.isInHitBox(mc.player, target)) {
Vector3d vec3d = this.getVector3d(mc.player, target);
float rawYaw = (float)MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(vec3d.z, vec3d.x)) - 90.0);
float rawPitch = (float)MathHelper.wrapDegrees(Math.toDegrees(-Math.atan2(vec3d.y, Math.hypot(vec3d.x, vec3d.z))));
float yawDelta = MathHelper.wrapDegrees(rawYaw - this.rotYaw);
float pitchDelta = MathHelper.wrapDegrees(rawPitch - this.rotPitch);
if (Math.abs(yawDelta) > 180.0F) {
yawDelta -= Math.signum(yawDelta) * 360.0F;
}
float additionYaw = MathHelper.clamp(yawDelta, -180.0F * speed, 180.0F * speed);
float additionPitch = MathHelper.clamp(pitchDelta, -90.0F * speed, 90.0F * speed);
float yaw = this.rotYaw + additionYaw + ThreadLocalRandom.current().nextFloat(-1.0F, 1.0F);
float pitch = this.rotPitch + additionPitch + ThreadLocalRandom.current().nextFloat(-1.0F, 1.0F);
this.rotYaw = GCDUtil.getSensitivity(yaw);
this.rotPitch = GCDUtil.getSensitivity(MathHelper.clamp(pitch, -89.0F, 89.0F));
}
}
private void updateAttack(LivingEntity target) {
if (this.settings.get(2) && mc.player.isBlocking()) {
mc.playerController.onStoppedUsingItem(mc.player);
} else if (this.settings.get(2)) {
return;
}
boolean sprint = false;
if (this.settings.get(0) && CEntityActionPacket.lastUpdatedSprint) {
mc.player.connection.sendPacket(new CEntityActionPacket(mc.player, Action.STOP_SPRINTING));
if (!mc.player.isInWater()) {
mc.player.setSprinting(false);
}
sprint = true;
}
this.cpsLimit = System.currentTimeMillis() + 550L;
this.attackEntity(target);
if (this.settings.get(4) && target.isBlocking()) {
int slot = InventoryUtil.getAxe(true);
if (slot == -1) {
return;
}
mc.player.connection.sendPacket(new CHeldItemChangePacket(slot));
this.attackEntity(target);
mc.player.connection.sendPacket(new CHeldItemChangePacket(mc.player.inventory.currentItem));
Managment.NOTIFICATION_MANAGER.add("Щит успещно сломан у " + target.getName().getString(), "Щит инфо", 3);
}
if (sprint) {
mc.player.connection.sendPacket(new CEntityActionPacket(mc.player, Action.START_SPRINTING));
}
}
private boolean canAttack() {
if (this.cpsLimit < System.currentTimeMillis() && !Managment.FUNCTION_MANAGER.autoPotionFunction.isActivePotion && !(this.getDistance(target) >= (double)this.range.getValue().floatValue()) && !(mc.player.getCooledAttackStrength(1.0F) <= 0.93F)) {
if ((!mc.player.isInWater() || !mc.player.areEyesInFluid(FluidTags.WATER)) && !mc.player.isInLava() && !mc.player.isOnLadder() && !mc.player.isRidingHorse() && !mc.player.abilities.isFlying && !mc.player.isElytraFlying() && !mc.player.isPotionActive(Effects.LEVITATION) && !mc.player.isPotionActive(Effects.SLOW_FALLING) && this.settings.get(0)) {
return this.space.get() && !mc.player.movementInput.jump || mc.player.fallDistance > 0.0F && !mc.player.isOnGround();
} else {
return true;
}
} else {
return false;
}
}
private LivingEntity findTarget() {
List<LivingEntity> targets = new ArrayList();
Iterator var2 = mc.world.getAllEntities().iterator();
while(true) {
LivingEntity living;
do {
do {
do {
do {
do {
do {
do {
Entity entity;
do {
if (!var2.hasNext()) {
if (targets.isEmpty()) {
return null;
}
if (targets.size() == 1) {
return (LivingEntity)targets.get(0);
}
Comparator var10001;
switch (this.sort.getIndex()) {
case 0:
var10001 = Comparator.comparingDouble(this::getDistance);
break;
case 1:
var10001 = Comparator.comparingDouble(LivingEntity::getHealth);
break;
case 2:
var10001 = Comparator.comparingDouble(this::getDegree);
break;
default:
var10001 = null;
}
return (LivingEntity)Collections.min(targets, var10001);
}
entity = (Entity)var2.next();
} while(!(entity instanceof LivingEntity));
living = (LivingEntity)entity;
} while(!this.isValid(living));
} while(!(this.getDistance(living) <= (double)(this.range.getValue().floatValue() + (this.mode.is("Обычная") ? this.preRange.getValue().floatValue() : 0.0F))));
} while(this.ignore.get(0) && Managment.FRIEND_MANAGER.isFriend(living.getName().getString()));
} while(this.ignore.get(1) && living.isInvisible());
} while((double)living.getHealth() < 0.01);
} while(this.ignore.get(2) && living instanceof PlayerEntity && living.getTotalArmorValue() == 0);
} while(this.ignore.get(3) && living instanceof PlayerEntity && !living.getUniqueID().equals(PlayerEntity.getOfflineUUID(living.getName().getString())));
targets.add(living);
}
}
private boolean isValid(LivingEntity entity) {
if (!(entity instanceof ArmorStandEntity) && entity != mc.player) {
if (entity instanceof PlayerEntity) {
return this.targets.get(0);
} else if (!(entity instanceof AnimalEntity) && !(entity instanceof VillagerEntity) && !(entity instanceof WaterMobEntity)) {
return !(entity instanceof MonsterEntity) && !(entity instanceof SlimeEntity) ? true : this.targets.get(2);
} else {
return this.targets.get(1);
}
} else {
return false;
}
}
private void updateClientRotation(float yaw, float pitch) {
mc.player.rotationYawHead = yaw;
mc.player.renderYawOffset = yaw;
mc.player.rotationPitchHead = pitch;
}
private void reset() {
this.rotYaw = mc.player.rotationYaw;
this.rotPitch = mc.player.rotationPitch;
target = null;
}
private void attackEntity(LivingEntity entity) {
mc.playerController.attackEntity(mc.player, entity);
mc.player.swingArm(Hand.MAIN_HAND);
}
private boolean isInHitBox(LivingEntity me, LivingEntity to) {
double wHalf = (double)(to.getWidth() / 2.0F);
double yExpand = MathHelper.clamp(me.getPosYEye() - to.getPosY(), 0.0, (double)to.getHeight());
double xExpand = MathHelper.clamp(mc.player.getPosX() - to.getPosX(), -wHalf, wHalf);
double zExpand = MathHelper.clamp(mc.player.getPosZ() - to.getPosZ(), -wHalf, wHalf);
return (new Vector3d(to.getPosX() - me.getPosX() + xExpand, to.getPosY() - me.getPosYEye() + yExpand, to.getPosZ() - me.getPosZ() + zExpand)).length() == 0.0;
}
private Vector3d getVector3d(LivingEntity me, LivingEntity to) {
double wHalf = (double)(to.getWidth() / 2.0F);
double yExpand = MathHelper.clamp(me.getPosYEye() - to.getPosY(), 0.0, (double)(to.getHeight() * (mc.player.getDistance(to) / this.range.getValue().floatValue())));
double xExpand = MathHelper.clamp(mc.player.getPosX() - to.getPosX(), -wHalf, wHalf);
double zExpand = MathHelper.clamp(mc.player.getPosZ() - to.getPosZ(), -wHalf, wHalf);
return new Vector3d(to.getPosX() - me.getPosX() + xExpand, to.getPosY() - me.getPosYEye() + yExpand, to.getPosZ() - me.getPosZ() + zExpand);
}
private double getDistance(LivingEntity entity) {
return this.getVector3d(mc.player, entity).length();
}
private double getDegree(LivingEntity entity) {
Vector3d vec = this.getVector3d(mc.player, entity);
double yaw = MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(vec.z, vec.x)) - 90.0);
double delta = MathHelper.wrapDegrees(yaw - (double)mc.player.rotationYaw);
if (Math.abs(delta) > 180.0) {
delta -= Math.signum(delta) * 360.0;
}
return Math.abs(delta);
}
private boolean isLookingAtMe(LivingEntity target) {
double x = target.getPosX() - mc.player.getPosX();
double z = target.getPosZ() - mc.player.getPosZ();
float entityYaw = MathHelper.wrapDegrees(target.rotationYaw);
double yaw = Math.toDegrees(Math.atan2(z, x)) + 90.0;
return Math.abs(MathHelper.wrapDegrees(yaw - (double)entityYaw)) <= 90.0;
}
private void drawCircle(LivingEntity target, EventRender e) {
EntityRendererManager rm = mc.getRenderManager();
double x = target.lastTickPosX + (target.getPosX() - target.lastTickPosX) * (double)e.partialTicks - rm.info.getProjectedView().getX();
double y = target.lastTickPosY + (target.getPosY() - target.lastTickPosY) * (double)e.partialTicks - rm.info.getProjectedView().getY();
double z = target.lastTickPosZ + (target.getPosZ() - target.lastTickPosZ) * (double)e.partialTicks - rm.info.getProjectedView().getZ();
float height = target.getHeight();
double duration = 2000.0;
double elapsed = (double)System.currentTimeMillis() % duration;
boolean side = elapsed > duration / 2.0;
double progress = elapsed / (duration / 2.0);
if (side) {
--progress;
} else {
progress = 1.0 - progress;
}
progress = progress < 0.5 ? 2.0 * progress * progress : 1.0 - Math.pow(-2.0 * progress + 2.0, 2.0) / 2.0;
double eased = (double)(height / 2.0F) * (progress > 0.5 ? 1.0 - progress : progress) * (double)(side ? -1 : 1);
RenderSystem.pushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(2848);
GL11.glHint(3154, 4354);
RenderSystem.disableTexture();
RenderSystem.enableBlend();
RenderSystem.disableAlphaTest();
RenderSystem.shadeModel(7425);
RenderSystem.disableCull();
RenderSystem.lineWidth(1.5F);
RenderSystem.color4f(-1.0F, -1.0F, -1.0F, -1.0F);
buffer.begin(8, DefaultVertexFormats.POSITION_COLOR);
float[] colors = null;
int i;
for(i = 0; i <= 360; ++i) {
colors = IntColor.rgb(Managment.STYLE_MANAGER.getCurrentStyle().getColor(i));
buffer.pos(x + Math.cos(Math.toRadians((double)i)) * (double)target.getWidth() * 0.8, y + (double)height * progress, z + Math.sin(Math.toRadians((double)i)) * (double)target.getWidth() * 0.8).color(colors[0], colors[1], colors[2], 0.5F).endVertex();
buffer.pos(x + Math.cos(Math.toRadians((double)i)) * (double)target.getWidth() * 0.8, y + (double)height * progress + eased, z + Math.sin(Math.toRadians((double)i)) * (double)target.getWidth() * 0.8).color(colors[0], colors[1], colors[2], 0.0F).endVertex();
}
buffer.finishDrawing();
WorldVertexBufferUploader.draw(buffer);
RenderSystem.color4f(-1.0F, -1.0F, -1.0F, -1.0F);
buffer.begin(2, DefaultVertexFormats.POSITION_COLOR);
for(i = 0; i <= 360; ++i) {
buffer.pos(x + Math.cos(Math.toRadians((double)i)) * (double)target.getWidth() * 0.8, y + (double)height * progress, z + Math.sin(Math.toRadians((double)i)) * (double)target.getWidth() * 0.8).color(colors[0], colors[1], colors[2], 0.5F).endVertex();
}
buffer.finishDrawing();
WorldVertexBufferUploader.draw(buffer);
RenderSystem.enableCull();
RenderSystem.disableBlend();
RenderSystem.enableTexture();
RenderSystem.enableAlphaTest();
GL11.glDepthMask(true);
GL11.glDisable(2848);
GL11.glHint(3154, 4354);
RenderSystem.shadeModel(7424);
RenderSystem.popMatrix();
}
protected void onDisable() {
super.onDisable();
this.reset();
}
protected void onEnable() {
super.onEnable();
this.reset();
}
public static LivingEntity getTarget() {
return target;
}
public float getRotYaw() {
return this.rotYaw;
}
public float getRotPitch() {
return this.rotPitch;
}
}