mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-15 16:05:28 +00:00
Effect: Don't allow cancellation of expired effect removal, close #1770
This commit is contained in:
parent
8d08840ea4
commit
36f3accf4b
@ -29,4 +29,11 @@ namespace pocketmine\event\entity;
|
|||||||
class EntityEffectRemoveEvent extends EntityEffectEvent{
|
class EntityEffectRemoveEvent extends EntityEffectEvent{
|
||||||
public static $handlerList = null;
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user