Начинающий
- Статус
- Оффлайн
- Регистрация
- 9 Дек 2023
- Сообщения
- 2
- Реакции
- 0
Вроде сделал ахуенные спиды но подфлагивает когда бьют . Baza Excellent Omni
speed:
package org.sheluvparis.excellent.client.impl.feature.impl.movement;
import net.minecraft.entity.Entity;
import org.sheluvparis.common.events.orbit.EventHandler;
import org.sheluvparis.excellent.client.Client;
import org.sheluvparis.excellent.client.events.player.UpdateEvent;
import net.minecraft.util.math.vector.Vector3d;
import org.sheluvparis.excellent.client.impl.feature.Category;
import org.sheluvparis.excellent.client.impl.feature.Feature;
import org.sheluvparis.excellent.client.impl.feature.FeatureInfo;
import org.sheluvparis.excellent.client.impl.feature.impl.combat.AttackAura;
import org.sheluvparis.excellent.client.impl.settings.impl.ModeSetting;
import org.sheluvparis.excellent.client.impl.settings.impl.SliderSetting;
import org.sheluvparis.excellent.client.impl.settings.impl.Unit;
@FeatureInfo(
name = "Speed",
description = "Спиды",
category = Category.MOVEMENT
)
public class Speed extends Feature {
private final ModeSetting mode = new ModeSetting("Режим", "Колизия");
private final SliderSetting predictionTicks =
new SliderSetting("Предикт позиции", 2.0F, 1.0F, 10.0F, 1.0F, Unit.EMPTY);
private final SliderSetting speedBoost =
new SliderSetting("Speed Boost", 1.15F, 1.0F, 5.0F, 0.05F, Unit.EMPTY);
private final SliderSetting smoothness =
new SliderSetting("Плавность", 0.5F, 0.05F, 1.0F, 0.05F, Unit.EMPTY); // 0 = резкое, 1 = плавное
@Override
public void init() {
super.init();
// порядок
settings().clear();
settings().add(mode);
settings().add(predictionTicks);
settings().add(speedBoost);
settings().add(smoothness);
}
@EventHandler
public void onUpdate(UpdateEvent event) {
if (mc.player == null || mc.world == null) return;
AttackAura attackAura = Client.inst().featureManager().attackAura;
if (!attackAura.enabled() || attackAura.target == null) {
return;
}
Entity target = attackAura.target;
if (mc.player.getBoundingBox().grow(0.5).intersects(target.getBoundingBox())) {
Vector3d dir = target.getPositionVec().subtract(mc.player.getPositionVec())
.scale(predictionTicks.get());
if (dir.lengthSquared() > 0.001) {
dir = dir.normalize();
Vector3d motion = mc.player.getMotion();
Vector3d targetMotion;
targetMotion = new Vector3d(
motion.x + dir.x * (speedBoost.get() - 1.0),
motion.y,
motion.z + dir.z * (speedBoost.get() - 1.0)
);
mc.player.setMotion(
smooth(motion.x, targetMotion.x, smoothness.get()),
motion.y,
smooth(motion.z, targetMotion.z, smoothness.get())
);
}
}
}
// Плавное движение
private double smooth(double current, double target, double factor) {
return current + (target - current) * factor;
}
}
Последнее редактирование: