Effect: Don't allow cancellation of expired effect removal, close #1770

This commit is contained in:
Dylan K. Taylor 2017-12-23 10:55:25 +00:00
parent 8d08840ea4
commit 36f3accf4b

View File

@ -29,4 +29,11 @@ namespace pocketmine\event\entity;
class EntityEffectRemoveEvent extends EntityEffectEvent{
public static $handlerList = null;
public function setCancelled(bool $value = true){
if($this->getEffect()->getDuration() <= 0){
throw new \InvalidStateException("Removal of expired effects cannot be cancelled");
}
parent::setCancelled($value);
}
}