From 426dee04a6ef56751329ce0371b3b3ac99fac82d Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 29 Sep 2018 15:39:20 +0100 Subject: [PATCH] Potion: remove unnecessary exception throw in getPotionEffectsById() this is only used by Potion and SplashPotion, and simply causes errors when trying to use potions with unknown IDs. --- src/pocketmine/item/Potion.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pocketmine/item/Potion.php b/src/pocketmine/item/Potion.php index 9760d6ae4..6a04fe73c 100644 --- a/src/pocketmine/item/Potion.php +++ b/src/pocketmine/item/Potion.php @@ -72,8 +72,6 @@ class Potion extends Item implements Consumable{ * * @param int $id * @return EffectInstance[] - * - * @throws \InvalidArgumentException if the potion type is unknown */ public static function getPotionEffectsById(int $id) : array{ switch($id){ @@ -213,7 +211,7 @@ class Potion extends Item implements Consumable{ ]; } - throw new \InvalidArgumentException("Unknown potion type $id"); + return []; } public function __construct(int $meta = 0){