mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
fix PHPStan
This commit is contained in:
parent
ff96f1b93c
commit
cab56b0479
@ -143,7 +143,7 @@ class Leaves extends Transparent{
|
||||
|
||||
$drops = [];
|
||||
if(mt_rand(1, 20) === 1){ //Saplings
|
||||
$drops[] = match($this->treeType){
|
||||
$drops[] = (match($this->treeType){
|
||||
TreeType::ACACIA() => VanillaBlocks::ACACIA_SAPLING(),
|
||||
TreeType::BIRCH() => VanillaBlocks::BIRCH_SAPLING(),
|
||||
TreeType::DARK_OAK() => VanillaBlocks::DARK_OAK_SAPLING(),
|
||||
@ -151,7 +151,7 @@ class Leaves extends Transparent{
|
||||
TreeType::OAK() => VanillaBlocks::OAK_SAPLING(),
|
||||
TreeType::SPRUCE() => VanillaBlocks::SPRUCE_SAPLING(),
|
||||
default => throw new AssumptionFailedError("Unreachable")
|
||||
};
|
||||
})->asItem();
|
||||
}
|
||||
if(($this->treeType->equals(TreeType::OAK()) || $this->treeType->equals(TreeType::DARK_OAK())) && mt_rand(1, 200) === 1){ //Apples
|
||||
$drops[] = VanillaItems::APPLE();
|
||||
|
@ -258,9 +258,9 @@ class CraftingManager{
|
||||
public function matchBrewingRecipe(Item $input, Item $ingredient) : ?BrewingRecipe{
|
||||
$inputHash = morton2d_encode($input->getId(), $input->getMeta());
|
||||
$ingredientHash = morton2d_encode($ingredient->getId(), $ingredient->getMeta());
|
||||
$recipe = $this->brewingRecipeCache[$inputHash][$ingredientHash] ?? null;
|
||||
if($recipe !== null){
|
||||
return $recipe;
|
||||
$cached = $this->brewingRecipeCache[$inputHash][$ingredientHash] ?? null;
|
||||
if($cached !== null){
|
||||
return $cached;
|
||||
}
|
||||
|
||||
foreach($this->potionContainerChangeRecipes as $recipe){
|
||||
|
Loading…
x
Reference in New Issue
Block a user