attachmentsPacket.ObjectData = new RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[attachments.size()];
for (int i = 0; i < attachments.size(); i++)
{
if (attachments.get(i) instanceof InventoryAttachment)
{
InventoryAttachment attachment = (InventoryAttachment)attachments.get(i);
attachmentsPacket.ObjectData[i] = new RezMultipleAttachmentsFromInvPacket.ObjectDataBlock();
attachmentsPacket.ObjectData[i].AttachmentPt = (byte)attachment.getAttachmentPoint().getIndex();
attachmentsPacket.ObjectData[i].EveryoneMask = (long)Permissions.PermissionMask.getIndex(attachment.Permissions.EveryoneMask);
attachmentsPacket.ObjectData[i].GroupMask = (long)Permissions.PermissionMask.getIndex(attachment.Permissions.GroupMask);
attachmentsPacket.ObjectData[i].ItemFlags = (long)attachment.Flags;
attachmentsPacket.ObjectData[i].ItemID = attachment.UUID;
attachmentsPacket.ObjectData[i].Name = Utils.stringToBytesWithTrailingNullByte(attachment.Name);