game-common / pragma.inventory / CraftingPlugin /

CraftingPlugin #

interface CraftingPlugin

Plugin to define crafting behavior, enabling arbitrary inventory transformations.

Functions #

NameSummary

craft

abstract fun craft(craftingEntry: CraftingEntryWrapper, destroyedInstancedItems: List<InstancedItem>, inventoryContent: InventoryServiceContent, requestExt: ExtCraftRequest): CraftingPlugin.CraftResult

Allows for performing arbitrary inventory transformations.

meetsRequirements

abstract fun meetsRequirements(craftingEntry: CraftingEntryWrapper, destroyedInstancedItems: List<InstancedItem>, inventoryData: InventoryData, ext: ExtCraftRequest): PragmaResult<Unit, List<String>>

Returns errors if a crafting entry cannot be crafted.