Context

class Context @JvmOverloads constructor(val recipe: CRecipe, val relation: MappedRelation, val mapped: Map<CoordinateComponent, ItemStack>, val shiftClicked: Boolean, val calledTimes: Int, val crafterId: UUID, val callMode: ResultSupplier.Context.CallMode, val asyncContext: AsyncContext? = null)

This class contains ResultSupplier parameters.

Parameters

recipe

A CRecipe instance what contains this

crafterId

Crafter UUID

relation

Coordinate mapping between a CRecipe and an input Inventory

mapped

Coordinates and input items mapping

shiftClicked

Shift-clicked or not

calledTimes

Calculated minimum amount with CMatter.amount

callMode

Indicates whether this invocation is a real craft or an icon generation for display (since 5.0.21)

asyncContext

Async context (since 5.0.20). When non-null, supply implementations should periodically check AsyncContext.isInterrupted and return early if true.

Constructors

Link copied to clipboard
constructor(recipe: CRecipe, relation: MappedRelation, mapped: Map<CoordinateComponent, ItemStack>, shiftClicked: Boolean, calledTimes: Int, crafterId: UUID, callMode: ResultSupplier.Context.CallMode, asyncContext: AsyncContext? = null)

Types

Link copied to clipboard

Indicates the purpose of a supply invocation.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun copyWith(asyncContext: AsyncContext? = null): ResultSupplier.Context

Copy with a given parameter.

Link copied to clipboard

Returns whether this inspection is async.

Link copied to clipboard

If no async context exists, returns a newly added one.