Adjacent Recipe
A semi-shaped recipe that sits between fully shaped and fully shapeless recipes.
Like a shapeless recipe, items may be placed anywhere in the crafting grid with no fixed positional constraints. Unlike a shapeless recipe, the directions in which neighbouring items may appear are restricted by RelationType:
RelationType.CROSS: all neighbouring items must be directly above, below, left, or right; diagonally adjacent items are forbidden (↑ ↓ ← → only).
RelationType.DIAGONAL: all neighbouring items must be at a diagonal corner; cross-adjacent items are forbidden (↖ ↗ ↙ ↘ only).
RelationType.BOTH: all eight surrounding directions are allowed; no restriction is applied.
Two items are considered "neighbours" if both their x-distance and y-distance are ≤ 1 (i.e. they fall inside the 3×3 area centred on either item). The predicate fails if any item has a neighbour in a direction not included in the chosen RelationType.
Example — RelationType.CROSS
Valid (no pair of items is diagonally adjacent):
_ _ # _ _ _
_ _ # _ _ _
_ _ # # # _
_ _ _ _ _ _
_ _ _ _ _ _
_ _ _ _ _ _Invalid (the # at (0,0) and the # at (1,1) are diagonal neighbours):
# _ _ _ _ _ ← (0,0)
# # _ _ _ _ ← (0,1) and (1,1): (0,0) is diagonal to (1,1) → forbidden for CROSS
_ _ _ _ _ _
_ _ _ _ _ _
_ _ _ _ _ _
_ _ _ _ _ _At least 2 items are required; isValidRecipe rejects recipes with fewer items.
Since
5.1.0
Parameters
Unique identifier for this recipe.
List of CMatter entries that make up the ingredients. Placement order within the grid is unconstrained (shapeless matching).
Adjacency rule applied to every placed item. Defaults to RelationType.BOTH.
Additional CRecipePredicate conditions evaluated before the adjacency check. Pass null or omit to apply no extra conditions.
ResultSupplier list that produces the craft output. null yields no result.
See also
Constructors
Types
Properties
List of CRecipePredicate that run during recipe matching. null or empty means no additional conditions.
Type of this recipe. See CRecipe.Type.
Functions
Returns CRecipePredicate inspection result on async.
Returns results of suppliers made asynchronously.
Returns CRecipePredicate inspection result
Returns results of suppliers made
Returns the minimum craft count calculated from input item amounts and recipe requirements.
Validates this recipe's configuration.
Maximum requires input items amount. Inclusive
Minimal requires input items amount