pocketmine\inventory\ShapelessRecipe::getIngredientList PHP Méthode

getIngredientList() public méthode

public getIngredientList ( ) : Item[]
Résultat pocketmine\item\Item[]
    public function getIngredientList()
    {
        $ingredients = [];
        foreach ($this->ingredients as $ingredient) {
            $ingredients[] = clone $ingredient;
        }
        return $ingredients;
    }

Usage Example

 private static function writeShapelessRecipe(ShapelessRecipe $recipe, BinaryStream $stream)
 {
     $stream->putInt($recipe->getIngredientCount());
     foreach ($recipe->getIngredientList() as $item) {
         $stream->putSlot($item);
     }
     $stream->putInt(1);
     $stream->putSlot($recipe->getResult());
     $stream->putUUID($recipe->getId());
     return CraftingDataPacket::ENTRY_SHAPELESS;
 }
All Usage Examples Of pocketmine\inventory\ShapelessRecipe::getIngredientList