mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 16:49:53 +00:00
ShapelessRecipe: make type parameter mandatory
This commit is contained in:
parent
4d79aced07
commit
ba4d038972
@ -37,11 +37,9 @@ class ShapelessRecipe implements CraftingRecipe{
|
|||||||
/**
|
/**
|
||||||
* @param RecipeIngredient[] $ingredients No more than 9 total. This applies to sum of item stack counts, not count of array.
|
* @param RecipeIngredient[] $ingredients No more than 9 total. This applies to sum of item stack counts, not count of array.
|
||||||
* @param Item[] $results List of result items created by this recipe.
|
* @param Item[] $results List of result items created by this recipe.
|
||||||
*
|
|
||||||
* TODO: we'll want to make the type parameter mandatory in PM5
|
|
||||||
*/
|
*/
|
||||||
public function __construct(array $ingredients, array $results, ?ShapelessRecipeType $type = null){
|
public function __construct(array $ingredients, array $results, ShapelessRecipeType $type){
|
||||||
$this->type = $type ?? ShapelessRecipeType::CRAFTING();
|
$this->type = $type;
|
||||||
|
|
||||||
if(count($ingredients) > 9){
|
if(count($ingredients) > 9){
|
||||||
throw new \InvalidArgumentException("Shapeless recipes cannot have more than 9 ingredients");
|
throw new \InvalidArgumentException("Shapeless recipes cannot have more than 9 ingredients");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user