ShapelessRecipe
in package
implements
CraftingRecipe
Interfaces, Classes, Traits and Enums
Table of Contents
- $ingredients : array<string|int, Item>
- $results : array<string|int, Item>
- __construct() : mixed
- getIngredientCount() : int
- getIngredientList() : array<string|int, Item>
- Returns a list of items needed to craft this recipe. This MUST NOT include Air items or items with a zero count.
- getResults() : array<string|int, Item>
- getResultsFor() : array<string|int, Item>
- Returns a list of results this recipe will produce when the inputs in the given crafting grid are consumed.
- matchesCraftingGrid() : bool
- Returns whether the given crafting grid meets the requirements to craft this recipe.
Properties
$ingredients
private
array<string|int, Item>
$ingredients
= []
$results
private
array<string|int, Item>
$results
Methods
__construct()
public
__construct(array<string|int, Item> $ingredients, array<string|int, Item> $results) : mixed
Parameters
- $ingredients : array<string|int, Item>
-
No more than 9 total. This applies to sum of item stack counts, not count of array.
- $results : array<string|int, Item>
-
List of result items created by this recipe.
Return values
mixed —getIngredientCount()
public
getIngredientCount() : int
Return values
int —getIngredientList()
Returns a list of items needed to craft this recipe. This MUST NOT include Air items or items with a zero count.
public
getIngredientList() : array<string|int, Item>
Return values
array<string|int, Item> —getResults()
public
getResults() : array<string|int, Item>
Return values
array<string|int, Item> —getResultsFor()
Returns a list of results this recipe will produce when the inputs in the given crafting grid are consumed.
public
getResultsFor(CraftingGrid $grid) : array<string|int, Item>
Parameters
- $grid : CraftingGrid
Return values
array<string|int, Item> —matchesCraftingGrid()
Returns whether the given crafting grid meets the requirements to craft this recipe.
public
matchesCraftingGrid(CraftingGrid $grid) : bool
Parameters
- $grid : CraftingGrid