// настройки
// BooleanSetting onlyPlayers = new BooleanSetting("OnlyPlayers", false);
// SliderSetting speed = new SliderSetting("speed", 8, 1, 8, 1);
// SliderSetting radius = new SliderSetting("radius", 1, 0.5f, 1.5f, 0.1f);
if ((mode.is("Collision")) && (mc.player.moveForward != 0 || mc.player.moveStrafing != 0F)) {
int collisions = 0;
for (Entity entity : mc.world.getAllEntities()) {
if (!(entity instanceof PlayerEntity) && onlyPlayers.isEnabled()) continue;
if (entity != mc.player && (entity instanceof LivingEntity || entity instanceof BoatEntity) && mc.player.getBoundingBox().expand(new Vector3d(radius.getValue(), radius.getValue(), radius.getValue())).intersects(entity.getBoundingBox()))
collisions++;
}
float yaw = aura.getTarget() == null ? mc.player.rotationYaw : aura.getRotationVector().x;
double[] motion = forward(((int)speed.getValue() * 0.01) * collisions, yaw);
mc.player.addVelocity(motion[0], 0.0, motion[1]);
}
public double[] forward(double s, float l) {
double f = mc.player.movementInput.moveForward;
double f2 = mc.player.movementInput.moveStrafe;
if (f != 0.0f) {
if (f2 > 0.0f) {
l += ((f > 0.0f) ? -45 : 45);
} else if (f2 < 0.0f) {
l += ((f > 0.0f) ? 45 : -45);
}
f2 = 0.0f;
if (f > 0.0f) {
f = 1.0f;
} else if (f < 0.0f) {
f = -1.0f;
}
}
final double d2 = Math.sin(Math.toRadians(l + 90.0f));
final double d3 = Math.cos(Math.toRadians(l + 90.0f));
final double d4 = f * s * d3 + f2 * s * d2;
final double d5 = f * s * d2 - f2 * s * d3;
return new double[]{d4, d5};
}