◆ __construct()
__construct |
( |
Item |
$result | ) |
|
◆ addIngredient()
addIngredient |
( |
Item |
$item | ) |
|
- Parameters
-
- Returns
- ShapelessRecipe
- Exceptions
-
79 if(count($this->ingredients) >= 9){
80 throw new \InvalidArgumentException(
"Shapeless recipes cannot have more than 9 ingredients");
86 while($item->getCount() > 0){
87 $this->ingredients[] = clone $it;
88 $item->setCount($item->getCount() - 1);
◆ getId()
- Returns
- null
Implements Recipe.
◆ getIngredientCount()
- Returns
- int
130 foreach($this->ingredients as $ingredient){
131 $count += $ingredient->getCount();
◆ getIngredientList()
- Returns
- Item[]
118 foreach($this->ingredients as $ingredient){
119 $ingredients[] = clone $ingredient;
◆ getResult()
- Returns
- Item
Implements Recipe.
68 return clone $this->output;
◆ registerToCraftingManager()
registerToCraftingManager |
( |
| ) |
|
◆ removeIngredient()
removeIngredient |
( |
Item |
$item | ) |
|
- Parameters
-
- Returns
- $this
100 foreach($this->ingredients as $index => $ingredient){
101 if($item->getCount() <= 0){
104 if($ingredient->equals($item, !$item->hasAnyDamageValue(), $item->hasCompoundTag())){
105 unset($this->ingredients[$index]);
106 $item->setCount($item->getCount() - 1);
◆ setId()
- Parameters
-
57 if($this->
id !== null){
58 throw new \InvalidStateException(
"Id is already set");
The documentation for this class was generated from the following file:
- src/pocketmine/inventory/ShapelessRecipe.php