Extensive work on building, wearables, assets, inventory, attachments, serialization, etc.

Resolves #36
This commit is contained in:
Casper Warden
2020-11-19 16:51:14 +00:00
parent 7b41239a39
commit 2ff00a30f8
58 changed files with 6659 additions and 2228 deletions

View File

@@ -9,6 +9,7 @@ import { UUID } from '../UUID';
import { Vector3 } from '../Vector3';
import { PacketFlags } from '../../enums/PacketFlags';
import { ChatSourceType } from '../../enums/ChatSourceType';
import { InventoryItem } from '../InventoryItem';
export class InventoryCommands extends CommandsBase
{
@@ -54,6 +55,23 @@ export class InventoryCommands extends CommandsBase
return await this.circuit.waitForAck(sequenceNo, 10000);
}
async getInventoryItem(item: UUID | string): Promise<InventoryItem>
{
if (typeof item === 'string')
{
item = new UUID(item);
}
const result = await this.currentRegion.agent.inventory.fetchInventoryItem(item);
if (result === null)
{
throw new Error('Unable to get inventory item');
}
else
{
return result;
}
}
async acceptInventoryOffer(event: InventoryOfferedEvent): Promise<void>
{
if (event.source === ChatSourceType.Object)