protected override void OnAfterRead(Network.Client client) { double relX = X - client.PlayerPosition.X; double relY = FeetY - client.PlayerPosition.FeetY; double relZ = Z - client.PlayerPosition.Z; client.PlayerPosition.X += relX; client.PlayerPosition.FeetY += relY; client.PlayerPosition.Z += relZ; client.PlayerPosition.Yaw = Yaw; client.PlayerPosition.Pitch = Pitch; client.PlayerPosition.OnGround = OnGround; EntityLookAndRelativeMovePacket packet = StateManager.FindState("play").GetSendPacket(0x17) as EntityLookAndRelativeMovePacket; packet.DX = relX; packet.DY = relY; packet.DZ = relZ; packet.Yaw = Yaw; packet.Pitch = Pitch; packet.Id = client.ID; client.AddBroadCast(packet, client); EntityHeadLookPacket headPacket = StateManager.FindState("play").GetSendPacket(0x19) as EntityHeadLookPacket; headPacket.Id = client.ID; headPacket.HeadYaw = Yaw; client.AddBroadCast(headPacket, client); }
protected override void OnAfterRead(Network.Client client) { client.PlayerPosition.Yaw = Yaw; client.PlayerPosition.Pitch = Pitch; EntityLookPacket packet = StateManager.FindState("play").GetSendPacket(0x16) as EntityLookPacket; packet.Id = client.ID; packet.Yaw = client.PlayerPosition.Yaw; packet.Pitch = client.PlayerPosition.Pitch; client.AddBroadCast(packet, client); EntityHeadLookPacket headPacket = StateManager.FindState("play").GetSendPacket(0x19) as EntityHeadLookPacket; headPacket.Id = client.ID; headPacket.HeadYaw = Yaw; client.AddBroadCast(headPacket, client); }