mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Testing handling multiple result items for ShapedRecipes
this doesn't work yet, I wanted to see how glitchy it is with cakes. The answer is: very glitchy.
This commit is contained in:
@ -66,13 +66,14 @@ class CraftingManager{
|
||||
$this->registerRecipe($result);
|
||||
break;
|
||||
case 1:
|
||||
// TODO: handle multiple result items
|
||||
$first = $recipe["output"][0];
|
||||
$outputs = $recipe["output"];
|
||||
$first = array_shift($outputs);
|
||||
|
||||
$this->registerRecipe(new ShapedRecipe(
|
||||
Item::jsonDeserialize($first),
|
||||
$recipe["shape"],
|
||||
array_map(function(array $data) : Item{ return Item::jsonDeserialize($data); }, $recipe["input"])
|
||||
array_map(function(array $data) : Item{ return Item::jsonDeserialize($data); }, $recipe["input"]),
|
||||
array_map(function(array $data) : Item{ return Item::jsonDeserialize($data); }, $recipe["output"])
|
||||
));
|
||||
break;
|
||||
case 2:
|
||||
|
Reference in New Issue
Block a user