fix PHPStan

This commit is contained in:
Dylan K. Taylor 2022-06-29 17:18:44 +01:00
parent ff96f1b93c
commit cab56b0479
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
2 changed files with 5 additions and 5 deletions

View File

@ -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();

View File

@ -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){