Начинающий
- Статус
- Оффлайн
- Регистрация
- 26 Июн 2025
- Сообщения
- 103
- Реакции
- 1
Сделал ротацую под спукитайм но неё банит не могу понять почему через ии напихал все что только можно было
SpookyTime Rotation:
private long nextSwitchDelay = 1200L;
private final TimerUtil switchTimer = new TimerUtil();
private final TimerUtil transitionTimer = new TimerUtil();
private static final long TRANSITION_DURATION = 250L;
private boolean isTransitioning = false;
private int currentPointIndex = 0;
private int previousPointIndex = 0;
/*
BODY POINTS
*/
private enum BodyPoint {
HEAD,
CHEST,
STOMACH,
LEGS
}
/*
SWITCH POINT
*/
private void switchToNextPoint() {
previousPointIndex = currentPointIndex;
currentPointIndex++;
if (currentPointIndex >= BodyPoint.values().length) {
currentPointIndex = 0;
}
isTransitioning = true;
transitionTimer.reset();
switchTimer.reset();
nextSwitchDelay =
ThreadLocalRandom.current()
.nextLong(1000, 1600);
}
/*
GET BODY VECTOR
*/
private Vector3d getBodyPoint(LivingEntity target, BodyPoint point) {
double y;
switch (point) {
case HEAD:
y = target.getPosYEye() - 0.15;
break;
case CHEST:
y = target.getPosY() + target.getHeight() * 0.75;
break;
case STOMACH:
y = target.getPosY() + target.getHeight() * 0.55;
break;
case LEGS:
y = target.getPosY() + target.getHeight() * 0.25;
break;
default:
y = target.getPosYEye();
break;
}
return new Vector3d(
target.getPosX(),
y,
target.getPosZ()
);
}
/*
SPOOKY ROTATION
*/
public void onSpookyRotation(LivingEntity target, boolean attack) {
if (target == null || mc.player == null) return;
float addyVacY = 0.02F * (float) Math.sin(System.currentTimeMillis() / 1200D);
float addyVacZ = 0.03F * (float) Math.sin(System.currentTimeMillis() / 900D)
+ 0.02F * (float) Math.cos(System.currentTimeMillis() / 1200D);
float addyVacX = 0.4F * (float) Math.cos(System.currentTimeMillis() / 700L)
+ 0.04F * (float) Math.sin(System.currentTimeMillis() / 900D);
Vector3d playerEyePos = mc.player.getEyePosition(mc.getRenderPartialTicks());
boolean attackF = false;
if (attack) tick = 4;
if (tick > 0) {
attackF = true;
tick--;
}
if (switchTimer.hasReached(nextSwitchDelay)) {
switchToNextPoint();
}
Vector3d targetPoint;
BodyPoint[] bodyPoints = BodyPoint.values();
if (isTransitioning && transitionTimer.getTime() < TRANSITION_DURATION) {
BodyPoint previousPoint = bodyPoints[previousPointIndex];
BodyPoint currentPoint = bodyPoints[currentPointIndex];
Vector3d prevPoint = getBodyPoint(target, previousPoint);
Vector3d currPoint = getBodyPoint(target, currentPoint);
float progress = MathHelper.clamp(
(float) transitionTimer.getTime() / TRANSITION_DURATION,
0.0F,
1.0F
);
float smoothProgress = progress < 0.5F
? 16.0F * progress * progress * progress * progress * progress
: 1.0F - (float) Math.pow(-2.0F * progress + 2.0F, 5.0F) / 2.0F;
targetPoint = new Vector3d(
MathHelper.lerp(smoothProgress, prevPoint.x, currPoint.x),
MathHelper.lerp(smoothProgress, prevPoint.y, currPoint.y),
MathHelper.lerp(smoothProgress, prevPoint.z, currPoint.z)
);
} else {
if (isTransitioning) {
isTransitioning = false;
}
targetPoint = getBodyPoint(target, bodyPoints[currentPointIndex]);
}
Vector3d attackTargetPoint = targetPoint;
if (attackF) {
BodyPoint attackPoint =
mc.player.getDistance(target) > 2.5
? BodyPoint.CHEST
: BodyPoint.HEAD;
attackTargetPoint = getBodyPoint(target, attackPoint);
}
Vector3d vec = attackTargetPoint
.add(addyVacZ * 0.03F, -addyVacY, addyVacX * 0.03F)
.subtract(playerEyePos)
.normalize();
float yaw = (float) Math.toDegrees(Math.atan2(-vec.x, vec.z));
float pitch = (float) MathHelper.clamp(
-Math.toDegrees(Math.atan2(vec.y, Math.hypot(vec.x, vec.z))),
-90,
90
);
float randomToAttack = 0;
if (attackF) {
randomToAttack = Mathf.random(-1.5F, 2.5F)
+ (float) (3 * Math.sin(System.currentTimeMillis() / 30D));
}
float randomXY = Mathf.random(-1, 2)
+ (float) (3 * Math.cos(System.currentTimeMillis() / 40D));
float randomX = Mathf.random(-1, 1)
+ (float) (3 * Math.sin(System.currentTimeMillis() / 70D));
Rotation newRotation = new Rotation(
yaw + randomXY + randomToAttack,
pitch + randomX
);
double distance = mc.player.getDistance(target);
float rotationSpeed;
if (distance <= 0.0) {
rotationSpeed = 3.5f;
} else if (distance <= 0.4) {
rotationSpeed = 5.0f;
} else if (distance <= 1.0) {
rotationSpeed = 7.5f;
} else if (distance <= 1.5) {
rotationSpeed = 10.0f;
} else if (distance <= 2.0) {
rotationSpeed = 17.0f;
} else if (distance <= 2.5) {
rotationSpeed = 21.0f;
} else {
rotationSpeed = Mathf.randomInt(40, 60);
}
if (rotationSpeed > 0) {
rotationSpeed += Mathf.random(-2.0f, 2.0f);
}
URotations.update(
newRotation,
rotationSpeed,
Mathf.randomValue(6, 8),
30,
30,
4,
15,
false
);
}