Начинающий
Начинающий
- Статус
- Оффлайн
- Регистрация
- 26 Май 2025
- Сообщения
- 4
- Реакции
- 0
Чё нужно добавить в ротацию для обхода SlothAC на CakeWorld? Помогите
(мой первый пост говном не лейте плиз)
private void cakeWorldRotation(LivingEntity entity) {
if (entity == null || Aura.mc.player == null) {
return;
}
if (this.selfRotation == null) {
this.selfRotation = new Vector2f(Aura.mc.player.rotationYaw, Aura.mc.player.rotationPitch);
return;
}
long now = System.currentTimeMillis();
this.cwLastRotTime = now;
boolean canAttack = this.canAttack();
if (Math.random() < (canAttack ? 0.05 : 0.15)) {
return;
}
if (this.cwAimTicks <= 0) {
this.cwTargetAimX = (float) (Math.random() - 0.5F) * entity.getWidth() * 0.8F;
this.cwTargetAimZ = (float) (Math.random() - 0.5F) * entity.getWidth() * 0.8F;
this.cwTargetAimY = (float) (0.1F + Math.random() * 0.8F) * entity.getHeight();
this.cwPitchRandomOffset = randomRange(-1.25F, 1.25F) * (canAttack ? 0.35F : 1.0F);
this.cwAimTicks = 10 + (int) (Math.random() * 15.0);
}
this.cwAimTicks--;
float aimLerpFactor = randomRange(0.12F, 0.18F);
this.cwAimX += (this.cwTargetAimX - this.cwAimX) * aimLerpFactor;
this.cwAimY += (this.cwTargetAimY - this.cwAimY) * aimLerpFactor;
this.cwAimZ += (this.cwTargetAimZ - this.cwAimZ) * aimLerpFactor;
boolean predictMovement = ((Boolean) this.resolver.getValue()).booleanValue()
&& ((Boolean) this.resolverPredict.getValue()).booleanValue();
float predictTicks = ((Float) this.resolverTicks.getValue()).floatValue();
float predictTicksFinal = predictTicks;
net.minecraft.util.math.vector.Vector3d predictedEntityPos = entity.getPositionVec();
if (predictMovement) {
predictTicksFinal = Math.max(0.0F, predictTicks + randomRange(-0.25F, 0.25F) * predictTicks);
predictTicksFinal = net.minecraft.util.math.MathHelper.clamp(predictTicksFinal, 0.0F, 10.0F);
net.minecraft.util.math.vector.Vector3d m = entity.getMotion();
double motionX = net.minecraft.util.math.MathHelper.clamp(m.x, -2.5D, 2.5D);
double motionY = net.minecraft.util.math.MathHelper.clamp(m.y, -1.5D, 1.5D);
double motionZ = net.minecraft.util.math.MathHelper.clamp(m.z, -2.5D, 2.5D);
predictedEntityPos = predictedEntityPos.add(motionX * predictTicksFinal, motionY * predictTicksFinal, motionZ * predictTicksFinal);
}
if (predictedEntityPos == null) {
return;
}
if (Double.isNaN(predictedEntityPos.x) || Double.isInfinite(predictedEntityPos.x)
|| Double.isNaN(predictedEntityPos.y) || Double.isInfinite(predictedEntityPos.y)
|| Double.isNaN(predictedEntityPos.z) || Double.isInfinite(predictedEntityPos.z)) {
return;
}
net.minecraft.util.math.vector.Vector3d targetPos = predictedEntityPos.add(this.cwAimX, this.cwAimY, this.cwAimZ);
net.minecraft.util.math.vector.Vector3d eyePos = Aura.mc.player.getEyePosition(1.0F);
net.minecraft.util.math.vector.Vector3d direction = targetPos.subtract(eyePos);
if (direction.lengthSquared() < 1.0E-8D) {
return;
}
float yawToTarget = (float) Math.toDegrees(Math.atan2(direction.z, direction.x)) - 90.0F;
float pitchToTarget = (float) (-Math.toDegrees(Math.atan2(direction.y, Math.hypot(direction.x, direction.z))));
if (Float.isNaN(yawToTarget) || Float.isInfinite(yawToTarget)
|| Float.isNaN(pitchToTarget) || Float.isInfinite(pitchToTarget)) {
return;
}
this.cwAccumulatedError += (float) (Math.random() - 0.5F) * 0.04F;
this.cwAccumulatedError *= 0.88F;
float pitchOffset = (this.cwPitchRandomOffset + this.cwAccumulatedError) * (canAttack ? 0.35F : 1.0F);
if (Math.random() < (canAttack ? 0.7 : 0.9)) {
pitchToTarget += pitchOffset;
}
float yawDelta = net.minecraft.util.math.MathHelper.wrapDegrees(yawToTarget - this.selfRotation.x);
float pitchDelta = pitchToTarget - this.selfRotation.y;
if (Float.isNaN(yawDelta) || Float.isInfinite(yawDelta)
|| Float.isNaN(pitchDelta) || Float.isInfinite(pitchDelta)) {
return;
}
float rotationDifference = (float) Math.hypot(Math.abs(yawDelta), Math.abs(pitchDelta));
if (rotationDifference <= 0.0F) {
return;
}
net.minecraft.util.math.vector.Vector3d playerPos = Aura.mc.player.getPositionVec();
float distanceToTarget = (float) playerPos.distanceTo(predictedEntityPos);
if (Float.isNaN(distanceToTarget) || Float.isInfinite(distanceToTarget)) {
return;
}
float baseSpeed = canAttack ? 0.93F : 0.56F;
float speed = baseSpeed;
if (distanceToTarget > 0 && distanceToTarget < 0.66F) {
float closeRangeSpeed = net.minecraft.util.math.MathHelper.clamp(distanceToTarget / 1.5F * 0.35F, 0.1F, 0.6F);
speed = canAttack ? 0.85F : Math.min(speed, closeRangeSpeed);
}
float speedVarianceMin = canAttack ? 0.96F : 0.9F;
float speedVarianceMax = canAttack ? 1.04F : 1.1F;
speed *= randomRange(speedVarianceMin, speedVarianceMax);
speed = net.minecraft.util.math.MathHelper.clamp(speed, 0.1F, 1.2F);
float lineYaw = (Math.abs(yawDelta / rotationDifference) * 180.0F);
float linePitch = (Math.abs(pitchDelta / rotationDifference) * 180.0F);
if (Float.isNaN(lineYaw) || Float.isInfinite(lineYaw)
|| Float.isNaN(linePitch) || Float.isInfinite(linePitch)) {
return;
}
float jitterYawMin = canAttack ? 0.8F : 20.0F;
float jitterYawMax = canAttack ? 2.2F : 26.0F;
double jitterYawDiv = canAttack ? 21D : 25D;
float jitterYaw = (float) (randomLerpCakeWorld(jitterYawMin, jitterYawMax) * Math.sin(now / jitterYawDiv));
float jitterPitch = (float) (randomLerpCakeWorld(canAttack ? 1.5F : 8.0F, canAttack ? 5.0F : 23.0F)
* Math.sin(now / (canAttack ? 29D : 27D)));
float moveYaw = net.minecraft.util.math.MathHelper.clamp(yawDelta, -lineYaw, lineYaw);
float movePitch = net.minecraft.util.math.MathHelper.clamp(pitchDelta, -linePitch, linePitch);
if (Float.isNaN(moveYaw) || Float.isInfinite(moveYaw)
|| Float.isNaN(movePitch) || Float.isInfinite(movePitch)) {
return;
}
float newYaw = net.minecraft.util.math.MathHelper.lerp(speed, this.selfRotation.x, this.selfRotation.x + moveYaw) + jitterYaw;
float newPitch = net.minecraft.util.math.MathHelper.lerp(speed, this.selfRotation.y, this.selfRotation.y + movePitch) + jitterPitch;
newPitch = net.minecraft.util.math.MathHelper.clamp(newPitch, -89.0F, 89.0F);
float appliedDeltaYaw = net.minecraft.util.math.MathHelper.wrapDegrees(newYaw - this.selfRotation.x);
float appliedDeltaPitch = newPitch - this.selfRotation.y;
if (Float.isNaN(newYaw) || Float.isInfinite(newYaw)
|| Float.isNaN(newPitch) || Float.isInfinite(newPitch)
|| Float.isNaN(appliedDeltaYaw) || Float.isInfinite(appliedDeltaYaw)
|| Float.isNaN(appliedDeltaPitch) || Float.isInfinite(appliedDeltaPitch)) {
return;
}
float gcdValue = GCDUtils.getGCDValue();
if (gcdValue > 0) {
appliedDeltaYaw -= appliedDeltaYaw % gcdValue;
appliedDeltaPitch -= appliedDeltaPitch % gcdValue;
newYaw = this.selfRotation.x + appliedDeltaYaw;
newPitch = net.minecraft.util.math.MathHelper.clamp(this.selfRotation.y + appliedDeltaPitch, -89.0F, 89.0F);
}
if (Math.abs(appliedDeltaYaw) < 0.005F && Math.abs(appliedDeltaPitch) < 0.005F) {
return;
}
this.cwPrevDeltaYaw = appliedDeltaYaw;
this.cwPrevDeltaPitch = appliedDeltaPitch;
this.selfRotation = new Vector2f(newYaw, newPitch);
}
(мой первый пост говном не лейте плиз)
private void cakeWorldRotation(LivingEntity entity) {
if (entity == null || Aura.mc.player == null) {
return;
}
if (this.selfRotation == null) {
this.selfRotation = new Vector2f(Aura.mc.player.rotationYaw, Aura.mc.player.rotationPitch);
return;
}
long now = System.currentTimeMillis();
this.cwLastRotTime = now;
boolean canAttack = this.canAttack();
if (Math.random() < (canAttack ? 0.05 : 0.15)) {
return;
}
if (this.cwAimTicks <= 0) {
this.cwTargetAimX = (float) (Math.random() - 0.5F) * entity.getWidth() * 0.8F;
this.cwTargetAimZ = (float) (Math.random() - 0.5F) * entity.getWidth() * 0.8F;
this.cwTargetAimY = (float) (0.1F + Math.random() * 0.8F) * entity.getHeight();
this.cwPitchRandomOffset = randomRange(-1.25F, 1.25F) * (canAttack ? 0.35F : 1.0F);
this.cwAimTicks = 10 + (int) (Math.random() * 15.0);
}
this.cwAimTicks--;
float aimLerpFactor = randomRange(0.12F, 0.18F);
this.cwAimX += (this.cwTargetAimX - this.cwAimX) * aimLerpFactor;
this.cwAimY += (this.cwTargetAimY - this.cwAimY) * aimLerpFactor;
this.cwAimZ += (this.cwTargetAimZ - this.cwAimZ) * aimLerpFactor;
boolean predictMovement = ((Boolean) this.resolver.getValue()).booleanValue()
&& ((Boolean) this.resolverPredict.getValue()).booleanValue();
float predictTicks = ((Float) this.resolverTicks.getValue()).floatValue();
float predictTicksFinal = predictTicks;
net.minecraft.util.math.vector.Vector3d predictedEntityPos = entity.getPositionVec();
if (predictMovement) {
predictTicksFinal = Math.max(0.0F, predictTicks + randomRange(-0.25F, 0.25F) * predictTicks);
predictTicksFinal = net.minecraft.util.math.MathHelper.clamp(predictTicksFinal, 0.0F, 10.0F);
net.minecraft.util.math.vector.Vector3d m = entity.getMotion();
double motionX = net.minecraft.util.math.MathHelper.clamp(m.x, -2.5D, 2.5D);
double motionY = net.minecraft.util.math.MathHelper.clamp(m.y, -1.5D, 1.5D);
double motionZ = net.minecraft.util.math.MathHelper.clamp(m.z, -2.5D, 2.5D);
predictedEntityPos = predictedEntityPos.add(motionX * predictTicksFinal, motionY * predictTicksFinal, motionZ * predictTicksFinal);
}
if (predictedEntityPos == null) {
return;
}
if (Double.isNaN(predictedEntityPos.x) || Double.isInfinite(predictedEntityPos.x)
|| Double.isNaN(predictedEntityPos.y) || Double.isInfinite(predictedEntityPos.y)
|| Double.isNaN(predictedEntityPos.z) || Double.isInfinite(predictedEntityPos.z)) {
return;
}
net.minecraft.util.math.vector.Vector3d targetPos = predictedEntityPos.add(this.cwAimX, this.cwAimY, this.cwAimZ);
net.minecraft.util.math.vector.Vector3d eyePos = Aura.mc.player.getEyePosition(1.0F);
net.minecraft.util.math.vector.Vector3d direction = targetPos.subtract(eyePos);
if (direction.lengthSquared() < 1.0E-8D) {
return;
}
float yawToTarget = (float) Math.toDegrees(Math.atan2(direction.z, direction.x)) - 90.0F;
float pitchToTarget = (float) (-Math.toDegrees(Math.atan2(direction.y, Math.hypot(direction.x, direction.z))));
if (Float.isNaN(yawToTarget) || Float.isInfinite(yawToTarget)
|| Float.isNaN(pitchToTarget) || Float.isInfinite(pitchToTarget)) {
return;
}
this.cwAccumulatedError += (float) (Math.random() - 0.5F) * 0.04F;
this.cwAccumulatedError *= 0.88F;
float pitchOffset = (this.cwPitchRandomOffset + this.cwAccumulatedError) * (canAttack ? 0.35F : 1.0F);
if (Math.random() < (canAttack ? 0.7 : 0.9)) {
pitchToTarget += pitchOffset;
}
float yawDelta = net.minecraft.util.math.MathHelper.wrapDegrees(yawToTarget - this.selfRotation.x);
float pitchDelta = pitchToTarget - this.selfRotation.y;
if (Float.isNaN(yawDelta) || Float.isInfinite(yawDelta)
|| Float.isNaN(pitchDelta) || Float.isInfinite(pitchDelta)) {
return;
}
float rotationDifference = (float) Math.hypot(Math.abs(yawDelta), Math.abs(pitchDelta));
if (rotationDifference <= 0.0F) {
return;
}
net.minecraft.util.math.vector.Vector3d playerPos = Aura.mc.player.getPositionVec();
float distanceToTarget = (float) playerPos.distanceTo(predictedEntityPos);
if (Float.isNaN(distanceToTarget) || Float.isInfinite(distanceToTarget)) {
return;
}
float baseSpeed = canAttack ? 0.93F : 0.56F;
float speed = baseSpeed;
if (distanceToTarget > 0 && distanceToTarget < 0.66F) {
float closeRangeSpeed = net.minecraft.util.math.MathHelper.clamp(distanceToTarget / 1.5F * 0.35F, 0.1F, 0.6F);
speed = canAttack ? 0.85F : Math.min(speed, closeRangeSpeed);
}
float speedVarianceMin = canAttack ? 0.96F : 0.9F;
float speedVarianceMax = canAttack ? 1.04F : 1.1F;
speed *= randomRange(speedVarianceMin, speedVarianceMax);
speed = net.minecraft.util.math.MathHelper.clamp(speed, 0.1F, 1.2F);
float lineYaw = (Math.abs(yawDelta / rotationDifference) * 180.0F);
float linePitch = (Math.abs(pitchDelta / rotationDifference) * 180.0F);
if (Float.isNaN(lineYaw) || Float.isInfinite(lineYaw)
|| Float.isNaN(linePitch) || Float.isInfinite(linePitch)) {
return;
}
float jitterYawMin = canAttack ? 0.8F : 20.0F;
float jitterYawMax = canAttack ? 2.2F : 26.0F;
double jitterYawDiv = canAttack ? 21D : 25D;
float jitterYaw = (float) (randomLerpCakeWorld(jitterYawMin, jitterYawMax) * Math.sin(now / jitterYawDiv));
float jitterPitch = (float) (randomLerpCakeWorld(canAttack ? 1.5F : 8.0F, canAttack ? 5.0F : 23.0F)
* Math.sin(now / (canAttack ? 29D : 27D)));
float moveYaw = net.minecraft.util.math.MathHelper.clamp(yawDelta, -lineYaw, lineYaw);
float movePitch = net.minecraft.util.math.MathHelper.clamp(pitchDelta, -linePitch, linePitch);
if (Float.isNaN(moveYaw) || Float.isInfinite(moveYaw)
|| Float.isNaN(movePitch) || Float.isInfinite(movePitch)) {
return;
}
float newYaw = net.minecraft.util.math.MathHelper.lerp(speed, this.selfRotation.x, this.selfRotation.x + moveYaw) + jitterYaw;
float newPitch = net.minecraft.util.math.MathHelper.lerp(speed, this.selfRotation.y, this.selfRotation.y + movePitch) + jitterPitch;
newPitch = net.minecraft.util.math.MathHelper.clamp(newPitch, -89.0F, 89.0F);
float appliedDeltaYaw = net.minecraft.util.math.MathHelper.wrapDegrees(newYaw - this.selfRotation.x);
float appliedDeltaPitch = newPitch - this.selfRotation.y;
if (Float.isNaN(newYaw) || Float.isInfinite(newYaw)
|| Float.isNaN(newPitch) || Float.isInfinite(newPitch)
|| Float.isNaN(appliedDeltaYaw) || Float.isInfinite(appliedDeltaYaw)
|| Float.isNaN(appliedDeltaPitch) || Float.isInfinite(appliedDeltaPitch)) {
return;
}
float gcdValue = GCDUtils.getGCDValue();
if (gcdValue > 0) {
appliedDeltaYaw -= appliedDeltaYaw % gcdValue;
appliedDeltaPitch -= appliedDeltaPitch % gcdValue;
newYaw = this.selfRotation.x + appliedDeltaYaw;
newPitch = net.minecraft.util.math.MathHelper.clamp(this.selfRotation.y + appliedDeltaPitch, -89.0F, 89.0F);
}
if (Math.abs(appliedDeltaYaw) < 0.005F && Math.abs(appliedDeltaPitch) < 0.005F) {
return;
}
this.cwPrevDeltaYaw = appliedDeltaYaw;
this.cwPrevDeltaPitch = appliedDeltaPitch;
this.selfRotation = new Vector2f(newYaw, newPitch);
}
Чё нужно добавить в ротацию для обхода SlothAC на CakeWorld? Помогите
(мой первый пост говном не лейте плиз)
private void cakeWorldRotation(LivingEntity entity) {
if (entity == null || Aura.mc.player == null) {
return;
}
if (this.selfRotation == null) {
this.selfRotation = new Vector2f(Aura.mc.player.rotationYaw, Aura.mc.player.rotationPitch);
return;
}
long now = System.currentTimeMillis();
this.cwLastRotTime = now;
boolean canAttack = this.canAttack();
if (Math.random() < (canAttack ? 0.05 : 0.15)) {
return;
}
if (this.cwAimTicks <= 0) {
this.cwTargetAimX = (float) (Math.random() - 0.5F) * entity.getWidth() * 0.8F;
this.cwTargetAimZ = (float) (Math.random() - 0.5F) * entity.getWidth() * 0.8F;
this.cwTargetAimY = (float) (0.1F + Math.random() * 0.8F) * entity.getHeight();
this.cwPitchRandomOffset = randomRange(-1.25F, 1.25F) * (canAttack ? 0.35F : 1.0F);
this.cwAimTicks = 10 + (int) (Math.random() * 15.0);
}
this.cwAimTicks--;
float aimLerpFactor = randomRange(0.12F, 0.18F);
this.cwAimX += (this.cwTargetAimX - this.cwAimX) * aimLerpFactor;
this.cwAimY += (this.cwTargetAimY - this.cwAimY) * aimLerpFactor;
this.cwAimZ += (this.cwTargetAimZ - this.cwAimZ) * aimLerpFactor;
boolean predictMovement = ((Boolean) this.resolver.getValue()).booleanValue()
&& ((Boolean) this.resolverPredict.getValue()).booleanValue();
float predictTicks = ((Float) this.resolverTicks.getValue()).floatValue();
float predictTicksFinal = predictTicks;
net.minecraft.util.math.vector.Vector3d predictedEntityPos = entity.getPositionVec();
if (predictMovement) {
predictTicksFinal = Math.max(0.0F, predictTicks + randomRange(-0.25F, 0.25F) * predictTicks);
predictTicksFinal = net.minecraft.util.math.MathHelper.clamp(predictTicksFinal, 0.0F, 10.0F);
net.minecraft.util.math.vector.Vector3d m = entity.getMotion();
double motionX = net.minecraft.util.math.MathHelper.clamp(m.x, -2.5D, 2.5D);
double motionY = net.minecraft.util.math.MathHelper.clamp(m.y, -1.5D, 1.5D);
double motionZ = net.minecraft.util.math.MathHelper.clamp(m.z, -2.5D, 2.5D);
predictedEntityPos = predictedEntityPos.add(motionX * predictTicksFinal, motionY * predictTicksFinal, motionZ * predictTicksFinal);
}
if (predictedEntityPos == null) {
return;
}
if (Double.isNaN(predictedEntityPos.x) || Double.isInfinite(predictedEntityPos.x)
|| Double.isNaN(predictedEntityPos.y) || Double.isInfinite(predictedEntityPos.y)
|| Double.isNaN(predictedEntityPos.z) || Double.isInfinite(predictedEntityPos.z)) {
return;
}
net.minecraft.util.math.vector.Vector3d targetPos = predictedEntityPos.add(this.cwAimX, this.cwAimY, this.cwAimZ);
net.minecraft.util.math.vector.Vector3d eyePos = Aura.mc.player.getEyePosition(1.0F);
net.minecraft.util.math.vector.Vector3d direction = targetPos.subtract(eyePos);
if (direction.lengthSquared() < 1.0E-8D) {
return;
}
float yawToTarget = (float) Math.toDegrees(Math.atan2(direction.z, direction.x)) - 90.0F;
float pitchToTarget = (float) (-Math.toDegrees(Math.atan2(direction.y, Math.hypot(direction.x, direction.z))));
if (Float.isNaN(yawToTarget) || Float.isInfinite(yawToTarget)
|| Float.isNaN(pitchToTarget) || Float.isInfinite(pitchToTarget)) {
return;
}
this.cwAccumulatedError += (float) (Math.random() - 0.5F) * 0.04F;
this.cwAccumulatedError *= 0.88F;
float pitchOffset = (this.cwPitchRandomOffset + this.cwAccumulatedError) * (canAttack ? 0.35F : 1.0F);
if (Math.random() < (canAttack ? 0.7 : 0.9)) {
pitchToTarget += pitchOffset;
}
float yawDelta = net.minecraft.util.math.MathHelper.wrapDegrees(yawToTarget - this.selfRotation.x);
float pitchDelta = pitchToTarget - this.selfRotation.y;
if (Float.isNaN(yawDelta) || Float.isInfinite(yawDelta)
|| Float.isNaN(pitchDelta) || Float.isInfinite(pitchDelta)) {
return;
}
float rotationDifference = (float) Math.hypot(Math.abs(yawDelta), Math.abs(pitchDelta));
if (rotationDifference <= 0.0F) {
return;
}
net.minecraft.util.math.vector.Vector3d playerPos = Aura.mc.player.getPositionVec();
float distanceToTarget = (float) playerPos.distanceTo(predictedEntityPos);
if (Float.isNaN(distanceToTarget) || Float.isInfinite(distanceToTarget)) {
return;
}
float baseSpeed = canAttack ? 0.93F : 0.56F;
float speed = baseSpeed;
if (distanceToTarget > 0 && distanceToTarget < 0.66F) {
float closeRangeSpeed = net.minecraft.util.math.MathHelper.clamp(distanceToTarget / 1.5F * 0.35F, 0.1F, 0.6F);
speed = canAttack ? 0.85F : Math.min(speed, closeRangeSpeed);
}
float speedVarianceMin = canAttack ? 0.96F : 0.9F;
float speedVarianceMax = canAttack ? 1.04F : 1.1F;
speed *= randomRange(speedVarianceMin, speedVarianceMax);
speed = net.minecraft.util.math.MathHelper.clamp(speed, 0.1F, 1.2F);
float lineYaw = (Math.abs(yawDelta / rotationDifference) * 180.0F);
float linePitch = (Math.abs(pitchDelta / rotationDifference) * 180.0F);
if (Float.isNaN(lineYaw) || Float.isInfinite(lineYaw)
|| Float.isNaN(linePitch) || Float.isInfinite(linePitch)) {
return;
}
float jitterYawMin = canAttack ? 0.8F : 20.0F;
float jitterYawMax = canAttack ? 2.2F : 26.0F;
double jitterYawDiv = canAttack ? 21D : 25D;
float jitterYaw = (float) (randomLerpCakeWorld(jitterYawMin, jitterYawMax) * Math.sin(now / jitterYawDiv));
float jitterPitch = (float) (randomLerpCakeWorld(canAttack ? 1.5F : 8.0F, canAttack ? 5.0F : 23.0F)
* Math.sin(now / (canAttack ? 29D : 27D)));
float moveYaw = net.minecraft.util.math.MathHelper.clamp(yawDelta, -lineYaw, lineYaw);
float movePitch = net.minecraft.util.math.MathHelper.clamp(pitchDelta, -linePitch, linePitch);
if (Float.isNaN(moveYaw) || Float.isInfinite(moveYaw)
|| Float.isNaN(movePitch) || Float.isInfinite(movePitch)) {
return;
}
float newYaw = net.minecraft.util.math.MathHelper.lerp(speed, this.selfRotation.x, this.selfRotation.x + moveYaw) + jitterYaw;
float newPitch = net.minecraft.util.math.MathHelper.lerp(speed, this.selfRotation.y, this.selfRotation.y + movePitch) + jitterPitch;
newPitch = net.minecraft.util.math.MathHelper.clamp(newPitch, -89.0F, 89.0F);
float appliedDeltaYaw = net.minecraft.util.math.MathHelper.wrapDegrees(newYaw - this.selfRotation.x);
float appliedDeltaPitch = newPitch - this.selfRotation.y;
if (Float.isNaN(newYaw) || Float.isInfinite(newYaw)
|| Float.isNaN(newPitch) || Float.isInfinite(newPitch)
|| Float.isNaN(appliedDeltaYaw) || Float.isInfinite(appliedDeltaYaw)
|| Float.isNaN(appliedDeltaPitch) || Float.isInfinite(appliedDeltaPitch)) {
return;
}
float gcdValue = GCDUtils.getGCDValue();
if (gcdValue > 0) {
appliedDeltaYaw -= appliedDeltaYaw % gcdValue;
appliedDeltaPitch -= appliedDeltaPitch % gcdValue;
newYaw = this.selfRotation.x + appliedDeltaYaw;
newPitch = net.minecraft.util.math.MathHelper.clamp(this.selfRotation.y + appliedDeltaPitch, -89.0F, 89.0F);
}
if (Math.abs(appliedDeltaYaw) < 0.005F && Math.abs(appliedDeltaPitch) < 0.005F) {
return;
}
this.cwPrevDeltaYaw = appliedDeltaYaw;
this.cwPrevDeltaPitch = appliedDeltaPitch;
this.selfRotation = new Vector2f(newYaw, newPitch);
}
Чё нужно добавить в ротацию для обхода SlothAC на CakeWorld? Помогите
(мой первый пост говном не лейте плиз)
private void cakeWorldRotation(LivingEntity entity) {
if (entity == null || Aura.mc.player == null) {
return;
}
if (this.selfRotation == null) {
this.selfRotation = new Vector2f(Aura.mc.player.rotationYaw, Aura.mc.player.rotationPitch);
return;
}
long now = System.currentTimeMillis();
this.cwLastRotTime = now;
boolean canAttack = this.canAttack();
if (Math.random() < (canAttack ? 0.05 : 0.15)) {
return;
}
if (this.cwAimTicks <= 0) {
this.cwTargetAimX = (float) (Math.random() - 0.5F) * entity.getWidth() * 0.8F;
this.cwTargetAimZ = (float) (Math.random() - 0.5F) * entity.getWidth() * 0.8F;
this.cwTargetAimY = (float) (0.1F + Math.random() * 0.8F) * entity.getHeight();
this.cwPitchRandomOffset = randomRange(-1.25F, 1.25F) * (canAttack ? 0.35F : 1.0F);
this.cwAimTicks = 10 + (int) (Math.random() * 15.0);
}
this.cwAimTicks--;
float aimLerpFactor = randomRange(0.12F, 0.18F);
this.cwAimX += (this.cwTargetAimX - this.cwAimX) * aimLerpFactor;
this.cwAimY += (this.cwTargetAimY - this.cwAimY) * aimLerpFactor;
this.cwAimZ += (this.cwTargetAimZ - this.cwAimZ) * aimLerpFactor;
boolean predictMovement = ((Boolean) this.resolver.getValue()).booleanValue()
&& ((Boolean) this.resolverPredict.getValue()).booleanValue();
float predictTicks = ((Float) this.resolverTicks.getValue()).floatValue();
float predictTicksFinal = predictTicks;
net.minecraft.util.math.vector.Vector3d predictedEntityPos = entity.getPositionVec();
if (predictMovement) {
predictTicksFinal = Math.max(0.0F, predictTicks + randomRange(-0.25F, 0.25F) * predictTicks);
predictTicksFinal = net.minecraft.util.math.MathHelper.clamp(predictTicksFinal, 0.0F, 10.0F);
net.minecraft.util.math.vector.Vector3d m = entity.getMotion();
double motionX = net.minecraft.util.math.MathHelper.clamp(m.x, -2.5D, 2.5D);
double motionY = net.minecraft.util.math.MathHelper.clamp(m.y, -1.5D, 1.5D);
double motionZ = net.minecraft.util.math.MathHelper.clamp(m.z, -2.5D, 2.5D);
predictedEntityPos = predictedEntityPos.add(motionX * predictTicksFinal, motionY * predictTicksFinal, motionZ * predictTicksFinal);
}
if (predictedEntityPos == null) {
return;
}
if (Double.isNaN(predictedEntityPos.x) || Double.isInfinite(predictedEntityPos.x)
|| Double.isNaN(predictedEntityPos.y) || Double.isInfinite(predictedEntityPos.y)
|| Double.isNaN(predictedEntityPos.z) || Double.isInfinite(predictedEntityPos.z)) {
return;
}
net.minecraft.util.math.vector.Vector3d targetPos = predictedEntityPos.add(this.cwAimX, this.cwAimY, this.cwAimZ);
net.minecraft.util.math.vector.Vector3d eyePos = Aura.mc.player.getEyePosition(1.0F);
net.minecraft.util.math.vector.Vector3d direction = targetPos.subtract(eyePos);
if (direction.lengthSquared() < 1.0E-8D) {
return;
}
float yawToTarget = (float) Math.toDegrees(Math.atan2(direction.z, direction.x)) - 90.0F;
float pitchToTarget = (float) (-Math.toDegrees(Math.atan2(direction.y, Math.hypot(direction.x, direction.z))));
if (Float.isNaN(yawToTarget) || Float.isInfinite(yawToTarget)
|| Float.isNaN(pitchToTarget) || Float.isInfinite(pitchToTarget)) {
return;
}
this.cwAccumulatedError += (float) (Math.random() - 0.5F) * 0.04F;
this.cwAccumulatedError *= 0.88F;
float pitchOffset = (this.cwPitchRandomOffset + this.cwAccumulatedError) * (canAttack ? 0.35F : 1.0F);
if (Math.random() < (canAttack ? 0.7 : 0.9)) {
pitchToTarget += pitchOffset;
}
float yawDelta = net.minecraft.util.math.MathHelper.wrapDegrees(yawToTarget - this.selfRotation.x);
float pitchDelta = pitchToTarget - this.selfRotation.y;
if (Float.isNaN(yawDelta) || Float.isInfinite(yawDelta)
|| Float.isNaN(pitchDelta) || Float.isInfinite(pitchDelta)) {
return;
}
float rotationDifference = (float) Math.hypot(Math.abs(yawDelta), Math.abs(pitchDelta));
if (rotationDifference <= 0.0F) {
return;
}
net.minecraft.util.math.vector.Vector3d playerPos = Aura.mc.player.getPositionVec();
float distanceToTarget = (float) playerPos.distanceTo(predictedEntityPos);
if (Float.isNaN(distanceToTarget) || Float.isInfinite(distanceToTarget)) {
return;
}
float baseSpeed = canAttack ? 0.93F : 0.56F;
float speed = baseSpeed;
if (distanceToTarget > 0 && distanceToTarget < 0.66F) {
float closeRangeSpeed = net.minecraft.util.math.MathHelper.clamp(distanceToTarget / 1.5F * 0.35F, 0.1F, 0.6F);
speed = canAttack ? 0.85F : Math.min(speed, closeRangeSpeed);
}
float speedVarianceMin = canAttack ? 0.96F : 0.9F;
float speedVarianceMax = canAttack ? 1.04F : 1.1F;
speed *= randomRange(speedVarianceMin, speedVarianceMax);
speed = net.minecraft.util.math.MathHelper.clamp(speed, 0.1F, 1.2F);
float lineYaw = (Math.abs(yawDelta / rotationDifference) * 180.0F);
float linePitch = (Math.abs(pitchDelta / rotationDifference) * 180.0F);
if (Float.isNaN(lineYaw) || Float.isInfinite(lineYaw)
|| Float.isNaN(linePitch) || Float.isInfinite(linePitch)) {
return;
}
float jitterYawMin = canAttack ? 0.8F : 20.0F;
float jitterYawMax = canAttack ? 2.2F : 26.0F;
double jitterYawDiv = canAttack ? 21D : 25D;
float jitterYaw = (float) (randomLerpCakeWorld(jitterYawMin, jitterYawMax) * Math.sin(now / jitterYawDiv));
float jitterPitch = (float) (randomLerpCakeWorld(canAttack ? 1.5F : 8.0F, canAttack ? 5.0F : 23.0F)
* Math.sin(now / (canAttack ? 29D : 27D)));
float moveYaw = net.minecraft.util.math.MathHelper.clamp(yawDelta, -lineYaw, lineYaw);
float movePitch = net.minecraft.util.math.MathHelper.clamp(pitchDelta, -linePitch, linePitch);
if (Float.isNaN(moveYaw) || Float.isInfinite(moveYaw)
|| Float.isNaN(movePitch) || Float.isInfinite(movePitch)) {
return;
}
float newYaw = net.minecraft.util.math.MathHelper.lerp(speed, this.selfRotation.x, this.selfRotation.x + moveYaw) + jitterYaw;
float newPitch = net.minecraft.util.math.MathHelper.lerp(speed, this.selfRotation.y, this.selfRotation.y + movePitch) + jitterPitch;
newPitch = net.minecraft.util.math.MathHelper.clamp(newPitch, -89.0F, 89.0F);
float appliedDeltaYaw = net.minecraft.util.math.MathHelper.wrapDegrees(newYaw - this.selfRotation.x);
float appliedDeltaPitch = newPitch - this.selfRotation.y;
if (Float.isNaN(newYaw) || Float.isInfinite(newYaw)
|| Float.isNaN(newPitch) || Float.isInfinite(newPitch)
|| Float.isNaN(appliedDeltaYaw) || Float.isInfinite(appliedDeltaYaw)
|| Float.isNaN(appliedDeltaPitch) || Float.isInfinite(appliedDeltaPitch)) {
return;
}
float gcdValue = GCDUtils.getGCDValue();
if (gcdValue > 0) {
appliedDeltaYaw -= appliedDeltaYaw % gcdValue;
appliedDeltaPitch -= appliedDeltaPitch % gcdValue;
newYaw = this.selfRotation.x + appliedDeltaYaw;
newPitch = net.minecraft.util.math.MathHelper.clamp(this.selfRotation.y + appliedDeltaPitch, -89.0F, 89.0F);
}
if (Math.abs(appliedDeltaYaw) < 0.005F && Math.abs(appliedDeltaPitch) < 0.005F) {
return;
}
this.cwPrevDeltaYaw = appliedDeltaYaw;
this.cwPrevDeltaPitch = appliedDeltaPitch;
this.selfRotation = new Vector2f(newYaw, newPitch);
}
Последнее редактирование: