game-common / pragma.inventory / CraftingPlugin / meetsRequirements /

meetsRequirements #

abstract suspend fun meetsRequirements(craftingEntry: CraftingEntryWrapper, destroyedInstancedItems: List<InstancedItem>, playerInventory: InventoryData, requestExt: ExtCraftRequest): PragmaResult<Unit, List<String>>

Returns errors if a crafting entry cannot be crafted.

Used by:

  • InventoryService.craftV1

Return #

Craft result containing all inventory transformations to apply.

Parameters #

craftingEntry

The crafting entry being checked.

destroyedInstancedItems

The list of instance items that would be destroyed if the craft were performed.

playerInventory

The player’s inventory data, used to decide to perform the craft operation.

requestExt

A customer-defined proto containing details about the current craft operation.