mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-11 12:27:51 +00:00
EntityExplodeEvent: clamp yield in range 0-100
This commit is contained in:
parent
7eaf1246a0
commit
afc6e8878d
@ -53,6 +53,9 @@ class EntityExplodeEvent extends EntityEvent implements Cancellable{
|
|||||||
$this->entity = $entity;
|
$this->entity = $entity;
|
||||||
$this->position = $position;
|
$this->position = $position;
|
||||||
$this->blocks = $blocks;
|
$this->blocks = $blocks;
|
||||||
|
if($yield < 0.0 || $yield > 100.0){
|
||||||
|
throw new \InvalidArgumentException("Yield must be in range 0.0 - 100.0");
|
||||||
|
}
|
||||||
$this->yield = $yield;
|
$this->yield = $yield;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,6 +83,9 @@ class EntityExplodeEvent extends EntityEvent implements Cancellable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function setYield(float $yield) : void{
|
public function setYield(float $yield) : void{
|
||||||
|
if($yield < 0.0 || $yield > 100.0){
|
||||||
|
throw new \InvalidArgumentException("Yield must be in range 0.0 - 100.0");
|
||||||
|
}
|
||||||
$this->yield = $yield;
|
$this->yield = $yield;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user