mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Implemented Respawn Anchor (#6646)
PlayerRespawnAnchorUseEvent is also added with options SET_SPAWN and EXPLODE, which allows plugins to customise the outcome of using the anchor in PM, which currently doesn't support dimensions. The event is also cancellable.
This commit is contained in:
@ -43,13 +43,15 @@ class EntityExplodeEvent extends EntityEvent implements Cancellable{
|
||||
|
||||
/**
|
||||
* @param Block[] $blocks
|
||||
* @param float $yield 0-100
|
||||
* @param float $yield 0-100
|
||||
* @param Block[] $ignitions
|
||||
*/
|
||||
public function __construct(
|
||||
Entity $entity,
|
||||
protected Position $position,
|
||||
protected array $blocks,
|
||||
protected float $yield
|
||||
protected float $yield,
|
||||
private array $ignitions
|
||||
){
|
||||
$this->entity = $entity;
|
||||
if($yield < 0.0 || $yield > 100.0){
|
||||
@ -98,4 +100,23 @@ class EntityExplodeEvent extends EntityEvent implements Cancellable{
|
||||
}
|
||||
$this->yield = $yield;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the list of blocks that will be replaced by fire.
|
||||
*
|
||||
* @param Block[] $ignitions
|
||||
*/
|
||||
public function setIgnitions(array $ignitions) : void{
|
||||
Utils::validateArrayValueType($ignitions, fn(Block $block) => null);
|
||||
$this->ignitions = $ignitions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of affected blocks that will be replaced by fire.
|
||||
*
|
||||
* @return Block[]
|
||||
*/
|
||||
public function getIgnitions() : array{
|
||||
return $this->ignitions;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user