fix /effect crash

This commit is contained in:
Dylan K. Taylor 2019-07-19 14:10:19 +01:00
parent 5a5ce84ebc
commit 0ebd3e6ca2

View File

@ -68,8 +68,9 @@ class EffectCommand extends VanillaCommand{
return true; return true;
} }
$effect = VanillaEffects::fromString($args[1]); try{
if($effect === null){ $effect = VanillaEffects::fromString($args[1]);
}catch(\InvalidArgumentException $e){
$sender->sendMessage(new TranslationContainer(TextFormat::RED . "%commands.effect.notFound", [(string) $args[1]])); $sender->sendMessage(new TranslationContainer(TextFormat::RED . "%commands.effect.notFound", [(string) $args[1]]));
return true; return true;
} }