MultiCraftingRecipe 5.47.0
Implements CraftingRecipe
A crafting table recipe whose logic is hardcoded in the Bedrock client (a "multi recipe", BedrockData special_hardcoded.json). Only its UUID and network ID are sent to the client; the result depends on what is in the crafting grid, so the server computes it from the grid as well.
Each non-empty grid slot is consumed once per repetition, so the ingredients of a craft are the grid contents themselves (MultiCraftingRecipe::getIngredientListFor()).
Register implementations with CraftingManager::registerSpecialCraftingRecipe().
Methods
computeResults() protected
abstract protected function computeResults(\pocketmine\crafting\CraftingGrid $grid) : ?arrayReturns the results of crafting with the given grid contents, or null if the grid doesn't match this recipe.
getIngredientListFor()
public function getIngredientListFor(\pocketmine\crafting\CraftingGrid $grid) : arrayReturns the ingredients consumed by one craft with the given grid contents: one of each non-empty slot.
getMultiRecipeUuid()
abstract public function getMultiRecipeUuid() : stringReturns the UUID the client knows this hardcoded recipe by.
getResultsFor()
public function getResultsFor(\pocketmine\crafting\CraftingGrid $grid) : arraymatchesCraftingGrid()
public function matchesCraftingGrid(\pocketmine\crafting\CraftingGrid $grid) : boolonCraftExecuted()
public function onCraftExecuted(array $outputs, ?\pocketmine\player\Player $player = null) : voidCalled once a craft with this recipe went through, for results that need more than the items themselves (e.g. the data of a new map). $player is the crafting player, or null when a crafter block crafted.
