Начинающий
- Статус
- Оффлайн
- Регистрация
- 30 Июн 2023
- Сообщения
- 71
- Реакции
- 0
- Выберите загрузчик игры
- ForgeOptiFine
SS (NoAD) -
Пожалуйста, авторизуйтесь для просмотра ссылки.
Code::
if (rotationModeValue.equals("CakeWorld")) {
box = target.getBoundingBox();
eyePos = mc.player.getEyePosition(1.0F);
step = 0.1D + ThreadLocalRandom.current().nextDouble(0.05D);
bestVec = null;
closestDistance = Double.MAX_VALUE;
double startX = box.minX + ThreadLocalRandom.current().nextDouble(-0.1, 0.1);
double startY = box.minY + ThreadLocalRandom.current().nextDouble(-0.1, 0.1);
double startZ = box.minZ + ThreadLocalRandom.current().nextDouble(-0.1, 0.1);
for (x = startX; x <= box.maxX; x += step) {
for (y = startY; y <= box.maxY; y += step) {
for (z = startZ; z <= box.maxZ; z += step) {
sample = new Vector3d(x, y, z);
dist = eyePos.distanceTo(sample);
if (dist < closestDistance || ThreadLocalRandom.current().nextDouble() < 0.1) {
closestDistance = dist;
bestVec = sample;
}
}
}
}
check = new Vector3d(
-(target.prevPosX - target.getPosX()) + ThreadLocalRandom.current().nextDouble(-0.02, 0.02),
-(target.prevPosY - target.getPosY()) + ThreadLocalRandom.current().nextDouble(-0.01, 0.01),
-(target.prevPosZ - target.getPosZ()) + ThreadLocalRandom.current().nextDouble(-0.02, 0.02)
);
xyi = this.canAttack(0) ? new Vector3d(0.0D, 0.0D, 0.0D) : check;
double centerOffsetX = ThreadLocalRandom.current().nextDouble(-0.05, 0.05);
double centerOffsetY = ThreadLocalRandom.current().nextDouble(-0.1, 0.2);
double centerOffsetZ = ThreadLocalRandom.current().nextDouble(-0.05, 0.05);
targetVec = (bestVec == null || !(eyePos.distanceTo(box.getCenter().add(centerOffsetX, 0.30000001192092896D + centerOffsetY, centerOffsetZ)) >
(double) ((Float) this.distance.getValue() - 0.2F))) &&
(bestVec == null || this.isHitBoxNotVisible(box.getCenter())) ?
box.getCenter().add(centerOffsetX, 0.30000001192092896D + centerOffsetY, centerOffsetZ).add(xyi) : bestVec;
time = System.nanoTime();
timeInSeconds = (double) time / 1.0E9D;
dist = Math.sin(timeInSeconds * 2.0D * 3.141592653589793D *
(2.0D + ThreadLocalRandom.current().nextDouble(-0.2, 0.2)));
float pitchAccelerationBase = mc.player.isElytraFlying() ? 90.0F :
(checkRtx(this.rotation.x, this.rotation.y, (Float) this.distance.getValue(), this.wallCheck.getValue(), true) ?
1.0F : (this.pitchAcceleration < 8.0F ? this.pitchAcceleration *
(1.65F + ThreadLocalRandom.current().nextFloat() * 0.3F) : 8.0F));
this.pitchAcceleration = pitchAccelerationBase;
float delta_yaw = MathHelper.wrapDegrees((float) MathHelper.wrapDegrees(
Math.toDegrees(Math.atan2(targetVec.z - mc.player.getPosZ(), targetVec.x - mc.player.getPosX())) -
(90.0D + ThreadLocalRandom.current().nextDouble(-2.0, 2.0))) - this.rotation.x);
float delta_pitch = (float) (-Math.toDegrees(Math.atan2(
targetVec.y - (mc.player.getPositionVec().y + (double) mc.player.getEyeHeight(mc.player.getPose())),
Math.sqrt(Math.pow(targetVec.x - mc.player.getPosX(), 2.0D) +
Math.pow(targetVec.z - mc.player.getPosZ(), 2.0D))))) - this.rotation.y;
if ((bestVec == null || !(eyePos.distanceTo(box.getCenter().add(centerOffsetX, 0.30000001192092896D + centerOffsetY, centerOffsetZ)) >
(double) ((Float) this.distance.getValue() - 0.2F))) &&
(bestVec == null || this.isHitBoxNotVisible(box.getCenter().add(centerOffsetX, 0.30000001192092896D + centerOffsetY, centerOffsetZ).add(xyi)))) {
double amplitudeMultiplier = 1.0 + ThreadLocalRandom.current().nextDouble(-0.2, 0.3);
delta_pitch = (float) ((double) delta_pitch + dist * (10.0D * amplitudeMultiplier));
delta_yaw = (float) ((double) delta_yaw + dist * (2.0D * amplitudeMultiplier));
}
lookVec = this.getLookVec(mc.player.rotationPitch, mc.player.rotationYaw);
pitchDerivative = target.getPositionVec().add(0.0D, (double) target.getHeight() / 2.0D, 0.0D);
Vector3d toEntity = pitchDerivative.subtract(eyePos).normalize();
double dot = lookVec.dotProduct(toEntity);
float angle = (float) Math.toDegrees(Math.acos(dot));
pitchStep = this.pitchAcceleration * (0.9F + ThreadLocalRandom.current().nextFloat() * 0.2F);
if (delta_yaw > 180.0F) {
delta_yaw -= 180.0F;
}
float deltaYawRandom = MathHelper.clamp(MathHelper.abs(delta_yaw),
-angle * (0.9F + ThreadLocalRandom.current().nextFloat() * 0.2F),
angle * (0.9F + ThreadLocalRandom.current().nextFloat() * 0.2F));
float deltaPitchRandom = MathHelper.clamp(delta_pitch,
-pitchStep * (0.9F + ThreadLocalRandom.current().nextFloat() * 0.2F),
pitchStep * (0.9F + ThreadLocalRandom.current().nextFloat() * 0.2F));
newYaw = this.rotation.x + (delta_yaw > 0.0F ? deltaYawRandom : -deltaYawRandom);
newPitch = MathHelper.clamp(this.rotation.y + deltaPitchRandom, -90.0F, 90.0F);
gcdFix = Math.pow(mc.gameSettings.mouseSensitivity * (0.6D + ThreadLocalRandom.current().nextDouble(-0.05, 0.05)) +
0.2D + ThreadLocalRandom.current().nextDouble(-0.02, 0.02),
3.0D + ThreadLocalRandom.current().nextDouble(-0.1, 0.1)) *
(1.2D + ThreadLocalRandom.current().nextDouble(-0.1, 0.1));
rotationYaw = (float) ((double) newYaw - (double) (newYaw - this.rotation.x) % gcdFix);
rotationPitch = (float) ((double) newPitch - (double) (newPitch - this.rotation.y) % gcdFix);
float microRandomYaw = ThreadLocalRandom.current().nextFloat() * 0.1F - 0.05F;
float microRandomPitch = ThreadLocalRandom.current().nextFloat() * 0.08F - 0.04F;
this.rotation.x = rotationYaw + microRandomYaw;
this.rotation.y = rotationPitch + microRandomPitch;
this.rotation.y = MathHelper.clamp(this.rotation.y, -90.0F, 90.0F);
this.rotationYawOffset = this.rotation.x + ThreadLocalRandom.current().nextFloat() * 0.02F - 0.01F;
}
