mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-06 18:11:52 +00:00
Fixed missing Cake recipe
TODO: add support for multiple crafting recipe result items
This commit is contained in:
parent
15f098074a
commit
663cb514e2
@ -54,7 +54,6 @@ class CraftingManager{
|
|||||||
switch($recipe["type"]){
|
switch($recipe["type"]){
|
||||||
case 0:
|
case 0:
|
||||||
// TODO: handle multiple result items
|
// TODO: handle multiple result items
|
||||||
if(count($recipe["output"]) === 1){
|
|
||||||
$first = $recipe["output"][0];
|
$first = $recipe["output"][0];
|
||||||
$result = new ShapelessRecipe(Item::get($first["id"], $first["damage"], $first["count"], $first["nbt"]));
|
$result = new ShapelessRecipe(Item::get($first["id"], $first["damage"], $first["count"], $first["nbt"]));
|
||||||
|
|
||||||
@ -62,11 +61,9 @@ class CraftingManager{
|
|||||||
$result->addIngredient(Item::get($ingredient["id"], $ingredient["damage"], $ingredient["count"], $first["nbt"]));
|
$result->addIngredient(Item::get($ingredient["id"], $ingredient["damage"], $ingredient["count"], $first["nbt"]));
|
||||||
}
|
}
|
||||||
$this->registerRecipe($result);
|
$this->registerRecipe($result);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
// TODO: handle multiple result items
|
// TODO: handle multiple result items
|
||||||
if(count($recipe["output"]) === 1){
|
|
||||||
$first = $recipe["output"][0];
|
$first = $recipe["output"][0];
|
||||||
$result = new ShapedRecipe(Item::get($first["id"], $first["damage"], $first["count"], $first["nbt"]), $recipe["height"], $recipe["width"]);
|
$result = new ShapedRecipe(Item::get($first["id"], $first["damage"], $first["count"], $first["nbt"]), $recipe["height"], $recipe["width"]);
|
||||||
|
|
||||||
@ -77,7 +74,6 @@ class CraftingManager{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->registerRecipe($result);
|
$this->registerRecipe($result);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
case 3:
|
case 3:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user