diff --git a/src/block/Leaves.php b/src/block/Leaves.php index e55ddcdc4..1283f912a 100644 --- a/src/block/Leaves.php +++ b/src/block/Leaves.php @@ -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(); diff --git a/src/crafting/CraftingManager.php b/src/crafting/CraftingManager.php index 516cf385b..777776f1f 100644 --- a/src/crafting/CraftingManager.php +++ b/src/crafting/CraftingManager.php @@ -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){