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