game-common / pragma.inventory / CraftingPlugin /

CraftingPlugin #

interface CraftingPlugin

Plugin to define crafting behavior, enabling arbitrary inventory transformations.

Functions #

NameSummary

craft

abstract suspend fun craft(craftingEntry: CraftingEntryWrapper, destroyedInstancedItems: List<InstancedItem>, playerInventory: InventoryData, inventoryContent: InventoryServiceContent, requestExt: ExtCraftRequest): InventoryModifications

Allows for performing arbitrary inventory transformations.

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.