Начинающий
Начинающий
- Статус
- Оффлайн
- Регистрация
- 5 Мар 2024
- Сообщения
- 8
- Реакции
- 1
mcp 1.21.4 своя база | При включение attack aura начинает флагать при передвижение, стою норм, fixmove есть но слабый, на hvh серверах тоже если че флагает. Понятно что из за разницы ротации килки и клиента, но как исправить хз, хелпаните.
сам ивент, часть из классов кубов(LocalPlayer).
сам ивент, часть из классов кубов(LocalPlayer).
EventMotion in LocalPlayer:
private final EventMotion motionEvent = new EventMotion(this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot(), this.onGround(), null);
private void sendPosition() {
this.sendIsSprintingIfNeeded();
if (this.isControlledCamera()) {
motionEvent.setX(this.getX());
motionEvent.setY(this.getY());
motionEvent.setZ(this.getZ());
motionEvent.setYaw(this.getYRot());
motionEvent.setPitch(this.getXRot());
motionEvent.setOnGround(this.onGround());
EventManager.call(motionEvent);
if (motionEvent.isCancelled()) {
motionEvent.intercept();
return;
}
double d0 = motionEvent.getX() - this.xLast;
double d1 = motionEvent.getY() - this.yLast;
double d2 = motionEvent.getZ() - this.zLast;
double d3 = motionEvent.getYaw() - this.yRotLast;
double d4 = motionEvent.getPitch() - this.xRotLast;
this.positionReminder++;
boolean flag = Mth.lengthSquared(d0, d1, d2) > Mth.square(2.0E-4) || this.positionReminder >= 20;
boolean flag1 = d3 != 0.0 || d4 != 0.0;
if (flag && flag1) {
this.connection
.send(
new ServerboundMovePlayerPacket.PosRot(
motionEvent.getX(), motionEvent.getY(), motionEvent.getZ(), motionEvent.getYaw(), motionEvent.getPitch(), this.onGround(), this.horizontalCollision
)
);
} else if (flag) {
this.connection
.send(new ServerboundMovePlayerPacket.Pos(motionEvent.getX(), motionEvent.getY(), motionEvent.getZ(), this.onGround(), this.horizontalCollision));
} else if (flag1) {
this.connection.send(new ServerboundMovePlayerPacket.Rot(motionEvent.getYaw(), motionEvent.getPitch(), this.onGround(), this.horizontalCollision));
} else if (this.lastOnGround != this.onGround() || this.lastHorizontalCollision != this.horizontalCollision) {
this.connection.send(new ServerboundMovePlayerPacket.StatusOnly(this.onGround(), this.horizontalCollision));
}
if (flag) {
this.xLast = motionEvent.getX();
this.yLast = motionEvent.getY();
this.zLast = motionEvent.getZ();
this.positionReminder = 0;
}
if (flag1) {
this.yRotLast = motionEvent.getYaw();
this.xRotLast = motionEvent.getPitch();
this.positionReminder = 0;
}
this.lastOnGround = motionEvent.isOnGround();
this.lastHorizontalCollision = this.horizontalCollision;
this.autoJumpEnabled = this.minecraft.options.autoJump().get();
EventManager.call(new PostMotionEvent());
if (motionEvent.getPostMotion() != null) {
motionEvent.getPostMotion().run();
}
}
}