mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-09 11:16:57 +00:00
Effect: Don't allow cancellation of expired effect removal, close #1770
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user