diff --git a/plugins/subspace_storage/instance.ts b/plugins/subspace_storage/instance.ts index c6b83156..6e059654 100644 --- a/plugins/subspace_storage/instance.ts +++ b/plugins/subspace_storage/instance.ts @@ -8,7 +8,7 @@ import { Item, } from "./messages"; -type IpcItems = { name: string, count: number }[]; +type IpcItems = [string, number][]; export class InstancePlugin extends lib.BaseInstancePlugin { pendingTasks!: Set; @@ -73,7 +73,7 @@ export class InstancePlugin extends lib.BaseInstancePlugin { return; } - const fromIpcItems = items.map(item => new Item(item.name, item.count)) + const fromIpcItems = items.map(item => new Item(item[0], item[1])) this.instance.sendTo("controller", new PlaceEvent(fromIpcItems)); if (this.instance.config.get("subspace_storage.log_item_transfers")) { @@ -85,7 +85,7 @@ export class InstancePlugin extends lib.BaseInstancePlugin { // request items -------------------------------------------------------------- async requestItems(requestItems: IpcItems) { // Request the items all at once - let fromIpcItems = requestItems.map(item => new Item(item.name, item.count)) + let fromIpcItems = requestItems.map(item => new Item(item[0], item[1])) let items = await this.instance.sendTo("controller", new RemoveRequest(fromIpcItems)); if (!items.length) { diff --git a/plugins/subspace_storage/messages.ts b/plugins/subspace_storage/messages.ts index 24ebedc2..cf392677 100644 --- a/plugins/subspace_storage/messages.ts +++ b/plugins/subspace_storage/messages.ts @@ -80,7 +80,7 @@ export class GetStorageRequest { export class UpdateStorageEvent { declare ["constructor"]: typeof UpdateStorageEvent; - static type = "request" as const; + static type = "event" as const; static src = "controller" as const; static dst = ["instance", "control"] as const; static plugin = "subspace_storage" as const;