ShapelessGroupRecipe

open class ShapelessGroupRecipe @JvmOverloads constructor(val name: String, val items: Map<CoordinateComponent, CMatter>, val groups: Set<MatchGroup>, val predicates: List<CRecipePredicate>? = null, val results: List<ResultSupplier>? = null) : CRecipe, UnPartialSearchableRecipe

Implementation of CRecipe.

This recipe only provides CRecipe.Type.SHAPELESS.

This is the SHAPELESS counterpart of GroupRecipe: groups states, for each set of recipe slots, how many of them must actually be matched to an input item (MatchGroup.min to MatchGroup.max). Unlike GroupRecipe, no Material.AIR placeholder candidate is needed to express "this slot may stay unmatched" — SHAPELESS matching has no concept of position, so an unmatched slot is simply absent from the resulting relation. The min/max bounds are enforced structurally by the matching itself (see io.github.sakaki_aruka.customcrafter.search.Search), so — again unlike GroupRecipe — no extra CRecipePredicate safety net is auto-appended here.

Since

5.3.0

Parameters

name

Name of this recipe

items

Item mapping. Coordinates are only used as unique slot identifiers; position is irrelevant.

groups

Groups covering every coordinate in items. Every coordinate must belong to exactly one group.

predicates

Additional predicates. Defaults to none.

results

See also

Constructors

Link copied to clipboard
constructor(name: String, items: Map<CoordinateComponent, CMatter>, groups: Set<MatchGroup>, predicates: List<CRecipePredicate>? = null, results: List<ResultSupplier>? = null)

Types

Link copied to clipboard
object Companion

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

Type of this recipe. See CRecipe.Type.

Functions

Link copied to clipboard

Returns CRecipePredicate inspection result on async.

Link copied to clipboard

Returns results of suppliers made asynchronously.

Link copied to clipboard

Returns the first CRecipePredicate that rejects context, or null when all of them pass.

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

Returns CRecipePredicate inspection result

Link copied to clipboard

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 the minimum craft count calculated from input item amounts and recipe requirements.

Link copied to clipboard
open override fun isValidRecipe()

Validates this CRecipe.

Link copied to clipboard
open override fun matchGroups(): List<MatchGroup>

Groups of recipe slots used by CRecipe.Type.SHAPELESS matching.

Link copied to clipboard

Maximum requires input items amount. Inclusive

Link copied to clipboard

Minimal requires input items amount