Improved EntityShootBowEvent

This commit is contained in:
Shoghi Cervantes
2014-10-08 16:36:43 +02:00
parent 7b09edf048
commit 64bf293c69
2 changed files with 31 additions and 9 deletions

View File

@ -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;
}
}