mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Added API method Item->pop()
This commit is contained in:
@ -82,12 +82,8 @@ class ShapelessRecipe implements CraftingRecipe{
|
||||
throw new \InvalidArgumentException("Shapeless recipes cannot have more than 9 ingredients");
|
||||
}
|
||||
|
||||
$it = clone $item;
|
||||
$it->setCount(1);
|
||||
|
||||
while($item->getCount() > 0){
|
||||
$this->ingredients[] = clone $it;
|
||||
$item->setCount($item->getCount() - 1);
|
||||
$this->ingredients[] = $item->pop();
|
||||
}
|
||||
|
||||
return $this;
|
||||
@ -105,7 +101,7 @@ class ShapelessRecipe implements CraftingRecipe{
|
||||
}
|
||||
if($ingredient->equals($item, !$item->hasAnyDamageValue(), $item->hasCompoundTag())){
|
||||
unset($this->ingredients[$index]);
|
||||
$item->setCount($item->getCount() - 1);
|
||||
$item->pop();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user