-
Автор темы
- #1
Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:
- бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
- маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
- приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
- обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.
Спасибо!
Пожалуйста, авторизуйтесь для просмотра ссылки.
module:
package net.evaware.module.modules;
import net.evaware.event.api.EventHandler;
import net.evaware.event.events.EventAttack;
import net.evaware.event.events.EventRender3D;
import net.evaware.module.api.Category;
import net.evaware.module.api.Module;
import net.evaware.module.setting.settings.BoolSetting;
import net.evaware.module.setting.settings.FloatSetting;
import net.evaware.module.setting.settings.ModeSetting;
import net.evaware.utils.math.TimerUtil;
import net.evaware.utils.player.PlayerUtils;
import net.evaware.utils.player.Rotation;
import net.evaware.utils.player.RotationUtil;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.item.AxeItem;
import net.minecraft.item.SwordItem;
import net.minecraft.util.math.Vec3d;
public class AimAssist extends Module {
public final ModeSetting mode = new ModeSetting("Mode", "Both", "Both", "Horizontal", "Vertical");
public final ModeSetting hitbox = new ModeSetting("Hitbox", "Eye", "Eye", "Center", "Bottom", "Adaptive");
public final BoolSetting onlyWeapon = new BoolSetting("OnlyWeapon", false);
public final BoolSetting rayCast = new BoolSetting("RayCast", false);
public final FloatSetting visibleTime = new FloatSetting("VisibleTime", 150, 100, 500, 10);
public final FloatSetting speed = new FloatSetting("Speed", 1f, 0.1f, 5, 0.1f);
public final FloatSetting range = new FloatSetting("Range", 5, 2.5f, 10, 0.1f);
public AimAssist() {
super("AimAssist", Category.Combat, "Модуль для игры раком");
}
public TimerUtil visibleTimer = new TimerUtil();
public Entity target;
[USER=1367676]@override[/USER]
public void onEnable() {
target = null;
super.onEnable();
}
[USER=1367676]@override[/USER]
public void onDisable() {
target = null;
super.onDisable();
}
@EventHandler
public void targetSelect(EventAttack e) {
if (e.getEntity() != null) {
target = e.getEntity();
visibleTimer.reset();
}
}
@EventHandler
public void aimAssistLogic(EventRender3D event) {
if (mc.currentScreen != null || !mc.isWindowFocused()) {
return;
}
if (onlyWeapon.getValue()) {
if (!(mc.player.getMainHandStack().getItem() instanceof SwordItem) && !(mc.player.getMainHandStack().getItem() instanceof AxeItem)) {
return;
}
}
Rotation.RotationVector rotation = new Rotation.RotationVector(mc.player.getYaw(), mc.player.getPitch());
if (target != null) {
Vec3d vec3d = target.getPos();
ClientPlayerEntity clientPlayerEntity3 = mc.player;
if (Math.sqrt(clientPlayerEntity3.squaredDistanceTo(vec3d.x, vec3d.y, vec3d.z)) > range.getValue()) {
target = null;
}
if (!RotationUtil.Instance.inRange(rotation, RotationUtil.Instance.getNeededRotations((float) vec3d.x, (float) (vec3d.y - getAdaptiveHeight(target)), (float) vec3d.z), 180)) {
target = null;
}
if (!target.isAlive()) {
target = null;
}
if (visibleTimer.isReached(visibleTime.getValue().longValue() * 10)) {
target = null;
}
}
if (target == null) {
visibleTimer.reset();
return;
}
Vec3d vec3d = target.getEyePos();
double d = vec3d.y - getHeight(target.getHeight());
Rotation.RotationVector rotation3 = RotationUtil.Instance.getNeededRotations((float) vec3d.x, (float) d, (float) vec3d.z);
float s = (speed.getMax() - speed.getValue()) * 2 + 0.1f;
boolean targetUnderCrosshair = PlayerUtils.getRtxTarget(mc.player.getYaw(), mc.player.getPitch(), range.getValue(), false) != null;
if (targetUnderCrosshair && rayCast.getValue()) {
s += 1;
}
switch (mode.getValue()) {
case "Vertical" -> RotationUtil.Instance.setPitch(rotation3, 1, 0, s);
case "Horizontal" -> RotationUtil.Instance.setYaw(rotation3, 1, 0, s);
case "Both" -> RotationUtil.Instance.setRotation(rotation3, 1, 1, s);
}
}
private double prevDiffY = 0;
private float getAdaptiveHeight(Entity target) {
if (target == null || mc.player == null) return 0.0f;
double playerEyeHeight = mc.player.getY() + mc.player.getEyeHeight(mc.player.getPose());
double targetTop = target.getY() + target.getHeight();
double diffY = targetTop - playerEyeHeight;
double velocityY = target.getVelocity().getY();
double changeDiffY = diffY - prevDiffY;
prevDiffY = diffY;
double baseHeight = target.getHeight() * 0.95;
if (Math.abs(diffY) < 0.3) {
baseHeight = target.getHeight() * 0.15;
} else {
baseHeight = target.getHeight() * 0.15;
}
if (diffY > 0.5) {
baseHeight += 0.1;
} else if (diffY < -0.5) {
baseHeight -= 0.05;
}
if (velocityY > 0.15) {
baseHeight += 0.15;
} else if (velocityY < -0.15) {
baseHeight -= 0.05;
}
double smoothnessFactor = Math.max(-0.1, Math.min(0.1, changeDiffY * 0.5));
baseHeight += smoothnessFactor;
return (float) Math.max(0.1, Math.min(target.getHeight() - 0.05, baseHeight));
}
private float getHeight(float f) {
return hitbox.is("Eye") ? 0 : (hitbox.is("Center") ? f / 2 : (hitbox.is("Bottom") ? f - 0.1f : getAdaptiveHeight(target)));
}
}
rotation util:
package net.evaware.utils.player;
import net.evaware.Evaware;
import net.evaware.utils.math.MathUtil;
import net.evaware.utils.math.RandomUtils;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.HitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.RaycastContext;
import static net.evaware.system.interfaces.IMinecraft.mc;
public class RotationUtil {
public static RotationUtil Instance = new RotationUtil();
public Rotation.RotationVector getNeededRotations(float f, float f2, float f3, float f4, float f5, float f6) {
double d = f - f4;
double d2 = f2 - f5;
double d3 = f3 - f6;
float[] fArray = new float[2];
fArray[0] = mc.player.getYaw();
fArray[1] = mc.player.getPitch();
return new Rotation.RotationVector(mc.player.getYaw() + wrap((float)Math.toDegrees(Math.atan2(d3, d)) - 90 - mc.player.getYaw()), fArray[1] + wrap(-((float)Math.toDegrees(Math.atan2(d2, Math.sqrt(d * d + d3 * d3)))) - fArray[1]));
}
public Rotation.RotationVector getNeededRotations(float f, float f2, float f3) {
Vec3d vec3d = mc.player.getEyePos();
double d = f - vec3d.x;
double d2 = f2 - vec3d.y;
double d3 = f3 - vec3d.z;
float[] fArray = new float[2];
fArray[0] = mc.player.getYaw();
fArray[1] = mc.player.getPitch();
return new Rotation.RotationVector(fArray[0] + wrap((float)Math.toDegrees(Math.atan2(d3, d)) - 90 - fArray[0]), fArray[1] + wrap((float)(-Math.toDegrees(Math.atan2(d2, Math.sqrt(d * d + d3 * d3)))) - fArray[1]));
}
public BlockHitResult blockRaycast(BlockPos blockPos) {
return mc.world.raycastBlock(mc.player.getEyePos(), mc.player.getEyePos().add(getPlayerLookVec(mc.player).multiply(6)), blockPos, VoxelShapes.fullCube(), mc.world.getBlockState(blockPos));
}
public HitResult playerRaycast(Rotation.RotationVector rotation) {
return mc.world.raycast(new RaycastContext(mc.player.getEyePos(), getPlayerLookVec(rotation).multiply(6).add(mc.player.getEyePos()), RaycastContext.ShapeType.OUTLINE, RaycastContext.FluidHandling.NONE, mc.player));
}
public Vec3d getPlayerLookVec(Rotation.RotationVector rotation) {
float f = (float)Math.PI / 180;
float f2 = (float)Math.PI;
float f3 = -MathHelper.cos(-rotation.getPitch() * f);
return new Vec3d(MathHelper.sin(-rotation.getYaw() * f - f2) * f3, MathHelper.sin(-rotation.getPitch() * f), MathHelper.cos(-rotation.getYaw() * f - f2) * f3).normalize();
}
public boolean setPitch(Rotation.RotationVector rotation, float f, float f2, float f3) {
setRotation(new Rotation.RotationVector(mc.player.getYaw(), MathUtil.interpolate(mc.player.getPitch(), rotation.getPitch() + f2 / 2, Evaware.renderService.getMs() * (1.1f - f) * 5 / f3)));
return mc.player.getPitch() - 5 < rotation.getPitch() && mc.player.getPitch() + 5 > rotation.getPitch();
}
Vec3d getPlayerLookVec(PlayerEntity playerEntity) {
float f = (float)Math.PI / 180;
float f2 = (float)Math.PI;
float f3 = -MathHelper.cos(-playerEntity.getPitch() * f);
return new Vec3d(MathHelper.sin(-playerEntity.getYaw() * f - f2) * f3, MathHelper.sin(-playerEntity.getPitch() * f), MathHelper.cos(-playerEntity.getYaw() * f - f2) * f3).normalize();
}
public void setRotation(Rotation.RotationVector rotation) {
mc.player.setYaw(rotation.getYaw());
mc.player.setPitch(rotation.getPitch());
}
public BlockHitResult blockRaycast(BlockPos blockPos, PlayerEntity playerEntity) {
return mc.world.raycastBlock(playerEntity.getEyePos(), getPlayerLookVec(playerEntity).multiply(6).add(playerEntity.getEyePos()), blockPos, VoxelShapes.fullCube(), mc.world.getBlockState(blockPos));
}
public BlockHitResult blockRaycastRotation(BlockPos blockPos, Rotation.RotationVector rotation) {
return mc.world.raycastBlock(mc.player.getEyePos(), getPlayerLookVec(rotation).multiply(6), blockPos, VoxelShapes.fullCube(), mc.world.getBlockState(blockPos));
}
float wrap(float f) {
float f2 = f;
if ((f2 %= 360) >= 180) {
f2 -= 360;
}
if (f2 < -180) {
f2 += 360;
}
return f2;
}
public Rotation.RotationVector getNeededRotations(Vec3d vec3d) {
return this.getNeededRotations((float)vec3d.x, (float)vec3d.y, (float)vec3d.z);
}
public boolean setYaw(Rotation.RotationVector rotation, float f, float f2, float f3) {
float f4 = MathUtil.interpolate(mc.player.getYaw(), rotation.getYaw() + f2 / 2, Evaware.renderService.getMs() * (1.1f - f) * 5 / f3);
float f5 = MathUtil.interpolate(mc.player.getPitch(), rotation.getPitch() + f2 / 2, Evaware.renderService.getMs() * (1.1f - f) * 5 / f3);
setRotation(new Rotation.RotationVector(f4, f5));
return mc.player.getYaw() - 5 < rotation.getYaw() && mc.player.getYaw() + 5 > rotation.getYaw();
}
public boolean setRotation(Rotation.RotationVector rotation, float f, float f2, float f3) {
float f4 = MathUtil.interpolate(mc.player.getYaw(), rotation.getYaw() + f2, Evaware.renderService.getMs() * (1.1f - f) * 5 / f3);
float f5 = MathUtil.interpolate(mc.player.getPitch(), rotation.getPitch() + f2 / 2, Evaware.renderService.getMs() * (1.1f - f) * 5 / f3);
setRotation(new Rotation.RotationVector(f4, f5));
return mc.player.getYaw() - 5 < rotation.getYaw() && mc.player.getYaw() + 5 > rotation.getYaw() && mc.player.getPitch() - 5 < rotation.getPitch() && mc.player.getPitch() + 5 > rotation.getPitch();
}
public boolean inRange(Rotation.RotationVector rotation, Rotation.RotationVector rotation2, float f) {
return Math.abs(rotation2.getYaw() - rotation.getYaw()) < f && Math.abs(rotation2.getPitch() - rotation.getPitch()) < f;
}
public void setRotation(float f, float f2) {
this.setRotation(new Rotation.RotationVector(f, f2));
}
}