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;
}
try{
$effect = VanillaEffects::fromString($args[1]);
if($effect === null){
}catch(\InvalidArgumentException $e){
$sender->sendMessage(new TranslationContainer(TextFormat::RED . "%commands.effect.notFound", [(string) $args[1]]));
return true;
}