GroupRecipe

open class GroupRecipe @JvmOverloads constructor(val name: String, val items: Map<CoordinateComponent, CMatter>, val groups: Set<GroupRecipe.Context>, val predicates: List<CRecipePredicate>? = listOf(recipePredicate), val results: List<ResultSupplier>? = null, val type: CRecipe.Type = CRecipe.Type.SHAPED) : CRecipe

Implementation of CRecipe.

This recipe only provides CRecipe.Type.SHAPED.

This recipe has groups what is a list of air-containable matter (GroupRecipe.Matter).

This recipe has the constraint that "all Context#members to which the key that returns the smallest CoordinateComponent#toIndex value in items belongs cannot have an element in candidate that satisfies Material#isAir."

items = {
(0, 0): [Material.AIR, Material.STONE],
(0, 1): [Material.COBBLESTONE]
}

// This is invalid groups. Group1 contains the minimum coordinate what keyed with a CMatter that contains Material.AIR.
groups = [Group1{ (0, 0) }, Group2{ (0, 1) }]
// Other invalid pattern
items = {
(0, 0): [Material.STONE],
(0, 1): [Material.AIR, Material.COBBLESTONE]
}

// This is invalid group.
groups = [Group1{ (0, 0), (0, 1) }]

GroupRecipe has to contains GroupRecipe.recipePredicate in GroupRecipe.predicates.

Since

5.0.15

Parameters

name

Name of this recipe

items

Item mapping

groups

Air-containable context set. It can be empty.

predicates

Predicates of this recipe. (default = listOf(GroupRecipe.recipePredicate))

results
type

See also

Constructors

Link copied to clipboard
constructor(name: String, items: Map<CoordinateComponent, CMatter>, groups: Set<GroupRecipe.Context>, predicates: List<CRecipePredicate>? = listOf(recipePredicate), results: List<ResultSupplier>? = null, type: CRecipe.Type = CRecipe.Type.SHAPED)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
class Context

Context of GroupRecipe

Link copied to clipboard
class Matter : CMatter

Air-containable CMatter implementation.

Properties

Link copied to clipboard
Link copied to clipboard
open override val items: Map<CoordinateComponent, CMatter>
Link copied to clipboard
open override val name: String
Link copied to clipboard
open override val predicates: List<CRecipePredicate>?
Link copied to clipboard
open override val results: List<ResultSupplier>?
Link copied to clipboard
open override val type: CRecipe.Type

Functions

Link copied to clipboard

Returns CRecipePredicate inspection result on async.

Link copied to clipboard
Link copied to clipboard
open fun getRecipePredicateResults(context: CRecipePredicate.Context, whenEmptyDefault: Boolean = true): Boolean

Returns CRecipePredicate inspection result

Link copied to clipboard
open fun getResults(context: ResultSupplier.Context): List<ItemStack>

Returns results of suppliers made

Link copied to clipboard
open fun getTimes(map: Map<CoordinateComponent, ItemStack>, relation: MappedRelation, shift: Boolean, withoutMass: Boolean = true): Int

Returns min amount

Link copied to clipboard
open override fun isValidRecipe(): Result<Unit>

Returns this CRecipe is a valid or not.

Link copied to clipboard

Maximum requires input items amount. Inclusive

Link copied to clipboard
open override fun requiresInputItemAmountMin(): Int

Minimal requires input items amount