- Выберите загрузчик игры
- OptiFine
Пожалуйста, авторизуйтесь для просмотра ссылки.
JavaScript:
case "Spookytime":
clampedYaw = Math.min(Math.max(Math.abs(yawDelta), 1.0E-4F), 22.5F);
clampedPitch = Math.min(Math.max(Math.abs(pitchDelta), 1.0E-4F), 7.0F);
randomYawFactor = (float)(Math.random() * (double)2.5F - (double)1.5F);
randomPitchFactor = (float)(Math.random() * (double)2.5F - (double)1.0F);
randomThreshold = (float)(Math.random() * (double)2.5F);
randomAddition = (float)(Math.random() * (double)3.5F + (double)2.5F);
float neckHeight = target.getEyeHeight() - 0.3f;
Vector3d targetPos = target.getPositionVec().add(0, neckHeight, 0);
if (this.selected == this.target) {
float randomOffsetX = (new Random().nextFloat() - 0.5f) * 0.1f;
float randomOffsetZ = (new Random().nextFloat() - 0.5f) * 0.1f;
targetPos = targetPos.add(randomOffsetX, 0, randomOffsetZ);
}
Vector3d vecToNeck = targetPos.subtract(mc.player.getEyePosition(1.0F));
yawToTarget = (float)MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(vecToNeck.z, vecToNeck.x)) - 90.0);
pitchToTarget = (float)(-Math.toDegrees(Math.atan2(vecToNeck.y, Math.hypot(vecToNeck.x, vecToNeck.z))));
yawDelta = MathHelper.wrapDegrees(yawToTarget - this.rotate.x);
pitchDelta = MathHelper.wrapDegrees(pitchToTarget - this.rotate.y);
if (this.selected != this.target) {
clampedPitch = Math.max(Math.abs(pitchDelta), 1.0F);
} else {
clampedPitch /= 3.0F;
}
if (Math.abs(clampedYaw - this.lastYaw) <= randomThreshold) {
clampedYaw = this.lastYaw + randomAddition;
}
clampedYaw += randomYawFactor;
clampedPitch += randomPitchFactor;
yaw = this.rotate.x + (yawDelta > 0.0F ? clampedYaw : -clampedYaw);
pitch = MathHelper.clamp(this.rotate.y + (pitchDelta > 0.0F ? clampedPitch : -clampedPitch), -80.0F, 70.0F);
gcd = SensUtility.getGCDValue();
yaw -= (yaw - this.rotate.x) % gcd;
pitch -= (pitch - this.rotate.y) % gcd;
this.rotate = new Vector2f(yaw, pitch);
this.lastYaw = clampedYaw;
this.lastPitch = clampedPitch;
break;
