addFurnaceRecipe() public méthode

public addFurnaceRecipe ( FurnaceRecipe $recipe )
$recipe pocketmine\inventory\FurnaceRecipe
Exemple #1
0
 public function sendRecipeList(Player $p)
 {
     $pk = new CraftingDataPacket();
     $pk->cleanRecipes = true;
     foreach ($this->getCraftingManager()->getRecipes() as $recipe) {
         if ($recipe instanceof ShapedRecipe) {
             $pk->addShapedRecipe($recipe);
         } elseif ($recipe instanceof ShapelessRecipe) {
             $pk->addShapelessRecipe($recipe);
         }
     }
     foreach ($this->getCraftingManager()->getFurnaceRecipes() as $recipe) {
         $pk->addFurnaceRecipe($recipe);
     }
     $p->dataPacket($pk);
 }
Exemple #2
0
 public function generateRecipeList()
 {
     $pk = new CraftingDataPacket();
     $pk->cleanRecipes = true;
     foreach ($this->getCraftingManager()->getRecipes() as $recipe) {
         if ($recipe instanceof ShapedRecipe) {
             $pk->addShapedRecipe($recipe);
         } elseif ($recipe instanceof ShapelessRecipe) {
             $pk->addShapelessRecipe($recipe);
         }
     }
     foreach ($this->getCraftingManager()->getFurnaceRecipes() as $recipe) {
         $pk->addFurnaceRecipe($recipe);
     }
     $pk->encode();
     $pk->isEncoded = true;
     $this->recipeList = $pk;
 }