Начинающий
Начинающий
- Статус
- Оффлайн
- Регистрация
- 1 Окт 2024
- Сообщения
- 121
- Реакции
- 0
- Выберите загрузчик игры
- Vanilla
- Forge
- NeoForge
- OptiFine
- ForgeOptiFine
- Прочие моды
Сделал через грок понял что это делает визуально лутше в модесеттинге ведь подротации визуально ну вы поняли блять я не умею описывать
после type пишем
и регаем в
addSettings
и новый case вставляем
в метод updateRotation после switch (type.get())
без сс это деф подротации которые мало где есть
после type пишем
Код:
ModeSetting vari = new ModeSetting("Тип Grim", "Lite", "Lite", "Test", "Old", "RW", "Snap-G").setVisible(() -> type.is("Grim"));
addSettings
и новый case вставляем
в метод updateRotation после switch (type.get())
Код:
case "Grim" -> {
float yaw = rotateVector.x;
float pitch = rotateVector.y;
switch (vari.get()) {
case "Old" -> {
if (attack && selected != target && options.getValueByName("Ускорять ротацию при атаке").get()) {
yaw = rotateVector.x + yawDelta;
pitch = clamp(rotateVector.y + pitchDelta, -89.0F, 89.0F);
} else {
float yawSpeed = Math.min(Math.max(Math.abs(yawDelta), 1.0f), rotationYawSpeed * 2.0f);
float pitchSpeed = Math.min(Math.max(Math.abs(pitchDelta), 1.0f), rotationPitchSpeed * 2.0f);
yaw = rotateVector.x + (yawDelta > 0 ? yawSpeed : -yawSpeed);
pitch = clamp(rotateVector.y + (pitchDelta > 0 ? pitchSpeed : -pitchSpeed), -89.0F, 89.0F);
}
float twitchIntensity = 0.15f;
float twitchFrequency = 0.03f;
if (Minecraft.player.ticksExisted % Math.max(1, (int) (twitchFrequency * 15)) == 0) {
yaw += (float) (Math.random() - 0.5) * twitchIntensity;
pitch += (float) (Math.random() - 0.5) * twitchIntensity;
}
yaw += (float) (Math.random() - 0.5) * 0.03f;
pitch += (float) (Math.random() - 0.5) * 0.03f;
float gcd = SensUtils.getGCDValue();
float gcdRandomizer = (float) (Math.random() * 0.008f + 0.996f);
yaw -= (yaw - rotateVector.x) % (gcd * gcdRandomizer);
pitch -= (pitch - rotateVector.y) % (gcd * gcdRandomizer);
float maxYawChange = 40.0f;
float maxPitchChange = 35.0f;
yaw = rotateVector.x + clamp(yaw - rotateVector.x, -maxYawChange, maxYawChange);
pitch = clamp(rotateVector.y + clamp(pitch - rotateVector.y, -maxPitchChange, maxPitchChange), -89.0F, 89.0F);
}
case "Test" -> {
float clampedYaw = Math.min(Math.max(Math.abs(yawDelta), 1.0F), rotationYawSpeed * 1.5F);
float clampedPitch = Math.min(Math.max(Math.abs(pitchDelta), 1.0F), rotationPitchSpeed * 1.5F);
if (Math.abs(clampedYaw - lastYaw) <= 1.0F) {
clampedYaw = lastYaw + 1.0F;
}
yaw = rotateVector.x + (yawDelta > 0.0F ? clampedYaw : -clampedYaw);
pitch = clamp(rotateVector.y + (pitchDelta > 0.0F ? clampedPitch : -clampedPitch), -90.0F, 90.0F);
float gcd = SensUtils.getGCDValue();
yaw -= (yaw - rotateVector.x) % gcd;
pitch -= (pitch - rotateVector.y) % gcd;
lastYaw = clampedYaw;
lastPitch = clampedPitch;
}
case "RW" -> {
float baseYawSpeed = 52.0f;
float basePitchSpeed = 44.0f;
float targetYaw = (float) MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(vec.z, vec.x)) - 90);
float targetPitch = (float) (-Math.toDegrees(Math.atan2(vec.y, hypot(vec.x, vec.z))));
targetPitch = clamp(targetPitch, -89.0F, 89.0F);
float yawDelta1 = wrapDegrees(targetYaw - rotateVector.x);
float pitchDelta1 = wrapDegrees(targetPitch - rotateVector.y);
float newYaw;
float newPitch;
if (attack && selected != target) {
float snapFactor = 0.88f + (Math.min(Math.abs(yawDelta1) / 90.0f, 1.0f) * 0.12f);
newYaw = rotateVector.x + yawDelta1 * snapFactor;
newPitch = rotateVector.y + pitchDelta1 * snapFactor;
} else {
float yawSpeed = Math.min(Math.abs(yawDelta1), baseYawSpeed);
float pitchSpeed = Math.min(Math.abs(pitchDelta1), basePitchSpeed);
newYaw = rotateVector.x + (yawDelta1 > 0 ? yawSpeed : -yawSpeed);
newPitch = rotateVector.y + (pitchDelta1 > 0 ? pitchSpeed : -pitchSpeed);
}
long time = System.currentTimeMillis();
float timeFactor = time * 0.001f;
if (Minecraft.player.ticksExisted % (3 + (int) (Math.sin(timeFactor) * 2)) == 0) {
float shakeIntensity = 0.12f + (float) Math.sin(timeFactor * 2.5f) * 0.06f;
newYaw += (RRandom.nextFloat() - 0.5f) * shakeIntensity;
newPitch += (RRandom.nextFloat() - 0.5f) * shakeIntensity * 0.8f;
}
newYaw += (RRandom.nextFloat() - 0.5f) * 0.018f;
newPitch += (RRandom.nextFloat() - 0.5f) * 0.014f;
float gcd = SensUtils.getGCDValue();
float gcdVariation = 0.985f + (RRandom.nextFloat() * 0.03f);
newYaw -= (newYaw - rotateVector.x) % (gcd * gcdVariation);
newPitch -= (newPitch - rotateVector.y) % (gcd * gcdVariation * 0.95f);
float maxChange = attack ? 38.0f : 28.0f;
newYaw = rotateVector.x + MathHelper.clamp(newYaw - rotateVector.x, -maxChange, maxChange);
newPitch = rotateVector.y + MathHelper.clamp(newPitch - rotateVector.y, -maxChange * 0.85f, maxChange * 0.85f);
newPitch = clamp(newPitch, -89.0F, 89.0F);
float smoothFactor = 0.78f + (RRandom.nextFloat() * 0.22f);
newYaw = rotateVector.x + (newYaw - rotateVector.x) * smoothFactor;
newPitch = rotateVector.y + (newPitch - rotateVector.y) * smoothFactor;
rotateVector = new Vector2f(newYaw, newPitch);
if (options.getValueByName("Коррекция движения").get()) {
Minecraft.player.rotationYawOffset = newYaw;
Minecraft.player.renderYawOffset = newYaw;
if (Minecraft.player.ticksExisted % 8 == 0) {
Minecraft.player.rotationYawHead += (RRandom.nextFloat() - 0.5f) * 0.6f;
}
}
lastYaw = newYaw;
lastPitch = newPitch;
if (time % 2000 < 100) {
float randomizer = 0.9f + (RRandom.nextFloat() * 0.2f);
rotateVector = new Vector2f(
rotateVector.x * randomizer,
clamp(rotateVector.y * randomizer, -89.0F, 89.0F)
);
}
}
case "Snap-G" -> {
float clampedYaw = Math.min(Math.max(Math.abs(yawDelta), 0.4f), rotationYawSpeed);
float clampedPitch = Math.min(Math.max(Math.abs(pitchDelta), 0.4f), rotationPitchSpeed);
if (attack && selected != target && options.getValueByName("Ускорять ротацию при атаке").get()) {
clampedPitch = Math.max(Math.abs(pitchDelta), 1f);
} else {
clampedPitch /= 3f;
}
if (Math.abs(clampedYaw - this.lastYaw) <= 0.01f) {
clampedYaw = this.lastYaw + 0.1f;
}
yaw = rotateVector.x + (yawDelta > 1 ? clampedYaw : -clampedYaw);
pitch = clamp(rotateVector.y + (pitchDelta > 0 ? clampedPitch : -clampedPitch), -360.0F, 360.0F);
float gcd = SensUtils.getGCDValue();
yaw -= (yaw - rotateVector.x) % gcd;
pitch -= (pitch - rotateVector.y) % gcd;
rotateVector = new Vector2f(yaw, pitch);
lastYaw = clampedYaw;
lastPitch = clampedPitch;
if (options.getValueByName("Коррекция движения").get()) {
Minecraft.player.rotationYawOffset = yaw;
}
}
case "Lite" -> {
float distanceFactor = (float) Math.sqrt(yawDelta * yawDelta + pitchDelta * pitchDelta) / 180.0f;
float yawSpeed = rotationYawSpeed * (1.5f + distanceFactor + (float) Math.random() * 0.5f);
float pitchSpeed = rotationPitchSpeed * (1.5f + distanceFactor + (float) Math.random() * 0.5f);
if (attack && selected != target && options.getValueByName("Ускорять ротацию при атаке").get()) {
yaw = rotateVector.x + yawDelta;
pitch = clamp(rotateVector.y + pitchDelta, -89.0F, 89.0F);
} else {
yaw = rotateVector.x + Math.copySign(Math.min(yawSpeed, Math.abs(yawDelta)), yawDelta);
pitch = clamp(rotateVector.y + Math.copySign(Math.min(pitchSpeed, Math.abs(pitchDelta)), pitchDelta), -89.0F, 89.0F);
}
float noiseIntensity = 0.05f + (float) Math.random() * 0.1f;
yaw += (float) (Math.random() - 0.5) * noiseIntensity;
pitch += (float) (Math.random() - 0.5) * noiseIntensity * 0.7f;
float gcd = SensUtils.getGCDValue();
float gcdRand = 0.93f + (float) Math.random() * 0.14f;
yaw -= (yaw - rotateVector.x) % (gcd * gcdRand);
pitch -= (pitch - rotateVector.y) % (gcd * gcdRand);
float maxYaw = 35.0f + (float) Math.random() * 10.0f;
float maxPitch = 30.0f + (float) Math.random() * 10.0f;
yaw = rotateVector.x + clamp(yaw - rotateVector.x, -maxYaw, maxYaw);
pitch = clamp(rotateVector.y + clamp(pitch - rotateVector.y, -maxPitch, maxPitch), -89.0F, 89.0F);
}
}
if (!vari.get().equals("Test")) {
lastYaw = yaw;
lastPitch = pitch;
}
rotateVector = new Vector2f(yaw, pitch);
if (options.getValueByName("Коррекция движения").get()) {
Minecraft.player.rotationYawOffset = yaw;
}
}
