Replace InvalidStateException usages with InvalidArgument or LogicException

This commit is contained in:
Dylan K. Taylor
2021-11-02 16:05:54 +00:00
parent 4eef458d29
commit e34364412b
15 changed files with 24 additions and 30 deletions

View File

@ -29,7 +29,7 @@ namespace pocketmine\event\entity;
class EntityEffectRemoveEvent extends EntityEffectEvent{
public function cancel() : void{
if($this->getEffect()->getDuration() <= 0){
throw new \InvalidStateException("Removal of expired effects cannot be cancelled");
throw new \LogicException("Removal of expired effects cannot be cancelled");
}
parent::cancel();
}