Skip to content

Commit ac7b5b3

Browse files
Merge 'stable' into 'minor-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/13743358576
2 parents 95284bc + 7af5eb3 commit ac7b5b3

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ PocketMine-MP accepts community contributions! The following resources will be u
6565
* [Building and running PocketMine-MP from source](BUILDING.md)
6666
* [Contributing Guidelines](CONTRIBUTING.md)
6767

68+
New here? Check out [issues with the "Easy task" label](https://github.com/pmmp/PocketMine-MP/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22Easy%20task%22) for things you could work to familiarise yourself with the codebase.
69+
6870
## Donate
6971
PocketMine-MP is free, but it requires a lot of time and effort from unpaid volunteers to develop. Donations enable us to keep delivering support for new versions and adding features your players love.
7072

src/crafting/ShapedRecipe.php

+2
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ public function __construct(array $shape, array $ingredients, array $results){
9797

9898
$this->shape = $shape;
9999

100+
Utils::validateArrayValueType($ingredients, function(RecipeIngredient $_) : void{});
100101
foreach(Utils::stringifyKeys($ingredients) as $char => $i){
101102
if(!str_contains(implode($this->shape), $char)){
102103
throw new \InvalidArgumentException("Symbol '$char' does not appear in the recipe shape");
@@ -105,6 +106,7 @@ public function __construct(array $shape, array $ingredients, array $results){
105106
$this->ingredientList[$char] = clone $i;
106107
}
107108

109+
Utils::validateArrayValueType($results, function(Item $_) : void{});
108110
$this->results = Utils::cloneObjectArray($results);
109111
}
110112

src/crafting/ShapelessRecipe.php

+2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ public function __construct(array $ingredients, array $results, ShapelessRecipeT
5353
if(count($ingredients) > 9){
5454
throw new \InvalidArgumentException("Shapeless recipes cannot have more than 9 ingredients");
5555
}
56+
Utils::validateArrayValueType($ingredients, function(RecipeIngredient $_) : void{});
5657
$this->ingredients = $ingredients;
58+
Utils::validateArrayValueType($results, function(Item $_) : void{});
5759
$this->results = Utils::cloneObjectArray($results);
5860
}
5961

0 commit comments

Comments
 (0)