Send ignore position ping after movement packet

This commit is contained in:
Goodlyay 2024-02-28 00:27:36 -08:00
parent 3a72699e30
commit 1ab445d8e5

View File

@ -360,14 +360,13 @@ namespace MCGalaxy.Network
// NOTE: Classic clients require offseting own entity by 22 units vertically // NOTE: Classic clients require offseting own entity by 22 units vertically
if (id == Entities.SelfID) pos.Y -= 22; if (id == Entities.SelfID) pos.Y -= 22;
DoIgnorePositionPing(id);
Send(Packet.Teleport(id, pos, rot, player.hasExtPositions)); Send(Packet.Teleport(id, pos, rot, player.hasExtPositions));
DoIgnorePositionPing(id);
} }
public override bool SendTeleport(byte id, Position pos, Orientation rot, public override bool SendTeleport(byte id, Position pos, Orientation rot,
Packet.TeleportMoveMode moveMode, bool usePos = true, bool interpolateOri = false, bool useOri = true) { Packet.TeleportMoveMode moveMode, bool usePos = true, bool interpolateOri = false, bool useOri = true) {
if (!Supports(CpeExt.ExtEntityTeleport)) { return false; } if (!Supports(CpeExt.ExtEntityTeleport)) { return false; }
DoIgnorePositionPing(id);
// NOTE: Classic clients require offseting own entity by 22 units vertically when using absolute location updates // NOTE: Classic clients require offseting own entity by 22 units vertically when using absolute location updates
if ((moveMode == Packet.TeleportMoveMode.AbsoluteInstant || if ((moveMode == Packet.TeleportMoveMode.AbsoluteInstant ||
@ -375,6 +374,7 @@ namespace MCGalaxy.Network
{ pos.Y -= 22; } { pos.Y -= 22; }
Send(Packet.TeleportExt(id, usePos, moveMode, useOri, interpolateOri, pos, rot, player.hasExtPositions)); Send(Packet.TeleportExt(id, usePos, moveMode, useOri, interpolateOri, pos, rot, player.hasExtPositions));
DoIgnorePositionPing(id);
return true; return true;
} }
void DoIgnorePositionPing(byte id) { void DoIgnorePositionPing(byte id) {
@ -567,7 +567,6 @@ namespace MCGalaxy.Network
rot.RotY = (byte)(256 - temp); rot.RotY = (byte)(256 - temp);
} }
DoIgnorePositionPing(id);
if (Supports(CpeExt.ExtPlayerList, 2)) { if (Supports(CpeExt.ExtPlayerList, 2)) {
Send(Packet.ExtAddEntity2(id, skin, name, pos, rot, player.hasCP437, player.hasExtPositions)); Send(Packet.ExtAddEntity2(id, skin, name, pos, rot, player.hasCP437, player.hasExtPositions));
@ -577,6 +576,7 @@ namespace MCGalaxy.Network
} else { } else {
Send(Packet.AddEntity(id, name, pos, rot, player.hasCP437, player.hasExtPositions)); Send(Packet.AddEntity(id, name, pos, rot, player.hasCP437, player.hasExtPositions));
} }
DoIgnorePositionPing(id);
} }
public override void SendLevel(Level prev, Level level) { public override void SendLevel(Level prev, Level level) {