PocketMine-MP 5.23.3 git-f7687af337d001ddbcc47b8e773f014a33faa662
|
Public Member Functions | |
__construct (array $shape, array $ingredients, array $results) | |
getHeight () | |
getIngredient (int $x, int $y) | |
getIngredientList () | |
getIngredientMap () | |
getResults () | |
getResultsFor (CraftingGrid $grid) | |
getShape () | |
getWidth () | |
matchesCraftingGrid (CraftingGrid $grid) | |
Definition at line 34 of file src/crafting/ShapedRecipe.php.
pocketmine\crafting\ShapedRecipe::__construct | ( | array | $shape, |
array | $ingredients, | ||
array | $results ) |
Constructs a ShapedRecipe instance.
string[] | $shape | Array of 1, 2, or 3 strings representing the rows of the recipe. This accepts an array of 1, 2 or 3 strings. Each string should be of the same length and must be at most 3 characters long. Each character represents a unique type of ingredient. Spaces are interpreted as air. |
RecipeIngredient[] | $ingredients | Char => Item map of items to be set into the shape. This accepts an array of Items, indexed by character. Every unique character (except space) in the shape array MUST have a corresponding item in this list. Space character is automatically treated as air. |
Item[] | $results | List of items that this recipe produces when crafted. |
Note: Recipes do not need to be square. Do NOT add padding for empty rows/columns.
@phpstan-param list<string> $shape @phpstan-param array<string, RecipeIngredient> $ingredients @phpstan-param list<Item> $results
Definition at line 73 of file src/crafting/ShapedRecipe.php.
pocketmine\crafting\ShapedRecipe::getHeight | ( | ) |
Definition at line 115 of file src/crafting/ShapedRecipe.php.
pocketmine\crafting\ShapedRecipe::getIngredient | ( | int | $x, |
int | $y ) |
Definition at line 166 of file src/crafting/ShapedRecipe.php.
pocketmine\crafting\ShapedRecipe::getIngredientList | ( | ) |
Returns a list of items needed to craft this recipe. This MUST NOT include Air items or items with a zero count.
Implements pocketmine\crafting\CraftingRecipe.
Definition at line 151 of file src/crafting/ShapedRecipe.php.
pocketmine\crafting\ShapedRecipe::getIngredientMap | ( | ) |
Definition at line 139 of file src/crafting/ShapedRecipe.php.
pocketmine\crafting\ShapedRecipe::getResults | ( | ) |
Definition at line 123 of file src/crafting/ShapedRecipe.php.
pocketmine\crafting\ShapedRecipe::getResultsFor | ( | CraftingGrid | $grid | ) |
Implements pocketmine\crafting\CraftingRecipe.
Definition at line 131 of file src/crafting/ShapedRecipe.php.
pocketmine\crafting\ShapedRecipe::getShape | ( | ) |
Returns an array of strings containing characters representing the recipe's shape.
Definition at line 175 of file src/crafting/ShapedRecipe.php.
pocketmine\crafting\ShapedRecipe::getWidth | ( | ) |
Definition at line 111 of file src/crafting/ShapedRecipe.php.
pocketmine\crafting\ShapedRecipe::matchesCraftingGrid | ( | CraftingGrid | $grid | ) |
Returns whether the given crafting grid meets the requirements to craft this recipe.
Implements pocketmine\crafting\CraftingRecipe.
Definition at line 199 of file src/crafting/ShapedRecipe.php.