mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-09 03:06:55 +00:00
Improved EntityShootBowEvent
This commit is contained in:
@ -21,6 +21,7 @@
|
||||
|
||||
namespace pocketmine\event\entity;
|
||||
|
||||
use pocketmine\entity\Entity;
|
||||
use pocketmine\entity\Living;
|
||||
use pocketmine\entity\Projectile;
|
||||
use pocketmine\event\Cancellable;
|
||||
@ -64,12 +65,25 @@ class EntityShootBowEvent extends EntityEvent implements Cancellable{
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Projectile
|
||||
* @return Entity
|
||||
*/
|
||||
public function getProjectile(){
|
||||
return $this->projectile;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Entity $projectile
|
||||
*/
|
||||
public function setProjectile(Entity $projectile){
|
||||
if($projectile !== $this->projectile){
|
||||
if(count($this->projectile->getViewers()) === 0){
|
||||
$this->projectile->kill();
|
||||
$this->projectile->close();
|
||||
}
|
||||
$this->projectile = $projectile;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return float
|
||||
*/
|
||||
@ -77,5 +91,12 @@ class EntityShootBowEvent extends EntityEvent implements Cancellable{
|
||||
return $this->force;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param float $force
|
||||
*/
|
||||
public function setForce($force){
|
||||
$this->force = $force;
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user