PocketMine-MP 5.18.1 git-9381fc4172e5dce4cada1cb356050c8a2ab57b94
|
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.
Definition at line 60 of file src/crafting/ShapedRecipe.php.
References pocketmine\utils\Utils\cloneObjectArray().
pocketmine\crafting\ShapedRecipe::getHeight | ( | ) |
Definition at line 102 of file src/crafting/ShapedRecipe.php.
pocketmine\crafting\ShapedRecipe::getIngredient | ( | int | $x, |
int | $y | ||
) |
Definition at line 153 of file src/crafting/ShapedRecipe.php.
pocketmine\crafting\ShapedRecipe::getIngredientList | ( | ) |
Implements pocketmine\crafting\CraftingRecipe.
Definition at line 138 of file src/crafting/ShapedRecipe.php.
pocketmine\crafting\ShapedRecipe::getIngredientMap | ( | ) |
Definition at line 123 of file src/crafting/ShapedRecipe.php.
pocketmine\crafting\ShapedRecipe::getResults | ( | ) |
Definition at line 109 of file src/crafting/ShapedRecipe.php.
pocketmine\crafting\ShapedRecipe::getResultsFor | ( | CraftingGrid | $grid | ) |
Implements pocketmine\crafting\CraftingRecipe.
Definition at line 116 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 161 of file src/crafting/ShapedRecipe.php.
pocketmine\crafting\ShapedRecipe::getWidth | ( | ) |
Definition at line 98 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 185 of file src/crafting/ShapedRecipe.php.