mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-05 11:27:07 +00:00
ExplosionPrimeEvent: require a positive explosion radius
This commit is contained in:
parent
3dd7c09351
commit
2ec65ba799
@ -44,6 +44,9 @@ class ExplosionPrimeEvent extends EntityEvent implements Cancellable{
|
||||
private $blockBreaking;
|
||||
|
||||
public function __construct(Entity $entity, float $force){
|
||||
if($force <= 0){
|
||||
throw new \InvalidArgumentException("Explosion radius must be positive");
|
||||
}
|
||||
$this->entity = $entity;
|
||||
$this->force = $force;
|
||||
$this->blockBreaking = true;
|
||||
@ -54,6 +57,9 @@ class ExplosionPrimeEvent extends EntityEvent implements Cancellable{
|
||||
}
|
||||
|
||||
public function setForce(float $force) : void{
|
||||
if($force <= 0){
|
||||
throw new \InvalidArgumentException("Explosion radius must be positive");
|
||||
}
|
||||
$this->force = $force;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user