mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
phpdoc armageddon for master, pass 1
This commit is contained in:
@ -45,16 +45,10 @@ class EntityBlockChangeEvent extends EntityEvent implements Cancellable{
|
||||
$this->to = $to;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Block
|
||||
*/
|
||||
public function getBlock() : Block{
|
||||
return $this->from;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Block
|
||||
*/
|
||||
public function getTo() : Block{
|
||||
return $this->to;
|
||||
}
|
||||
|
@ -30,19 +30,11 @@ class EntityCombustByBlockEvent extends EntityCombustEvent{
|
||||
/** @var Block */
|
||||
protected $combuster;
|
||||
|
||||
/**
|
||||
* @param Block $combuster
|
||||
* @param Entity $combustee
|
||||
* @param int $duration
|
||||
*/
|
||||
public function __construct(Block $combuster, Entity $combustee, int $duration){
|
||||
parent::__construct($combustee, $duration);
|
||||
$this->combuster = $combuster;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Block
|
||||
*/
|
||||
public function getCombuster() : Block{
|
||||
return $this->combuster;
|
||||
}
|
||||
|
@ -29,19 +29,11 @@ class EntityCombustByEntityEvent extends EntityCombustEvent{
|
||||
/** @var Entity */
|
||||
protected $combuster;
|
||||
|
||||
/**
|
||||
* @param Entity $combuster
|
||||
* @param Entity $combustee
|
||||
* @param int $duration
|
||||
*/
|
||||
public function __construct(Entity $combuster, Entity $combustee, int $duration){
|
||||
parent::__construct($combustee, $duration);
|
||||
$this->combuster = $combuster;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Entity
|
||||
*/
|
||||
public function getCombuster() : Entity{
|
||||
return $this->combuster;
|
||||
}
|
||||
|
@ -33,10 +33,6 @@ class EntityCombustEvent extends EntityEvent implements Cancellable{
|
||||
/** @var int */
|
||||
protected $duration;
|
||||
|
||||
/**
|
||||
* @param Entity $combustee
|
||||
* @param int $duration
|
||||
*/
|
||||
public function __construct(Entity $combustee, int $duration){
|
||||
$this->entity = $combustee;
|
||||
$this->duration = $duration;
|
||||
@ -44,7 +40,6 @@ class EntityCombustEvent extends EntityEvent implements Cancellable{
|
||||
|
||||
/**
|
||||
* Returns the duration in seconds the entity will burn for.
|
||||
* @return int
|
||||
*/
|
||||
public function getDuration() : int{
|
||||
return $this->duration;
|
||||
|
@ -34,10 +34,6 @@ class EntityDamageByBlockEvent extends EntityDamageEvent{
|
||||
private $damager;
|
||||
|
||||
/**
|
||||
* @param Block $damager
|
||||
* @param Entity $entity
|
||||
* @param int $cause
|
||||
* @param float $damage
|
||||
* @param float[] $modifiers
|
||||
*/
|
||||
public function __construct(Block $damager, Entity $entity, int $cause, float $damage, array $modifiers = []){
|
||||
@ -45,9 +41,6 @@ class EntityDamageByBlockEvent extends EntityDamageEvent{
|
||||
parent::__construct($entity, $cause, $damage, $modifiers);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Block
|
||||
*/
|
||||
public function getDamager() : Block{
|
||||
return $this->damager;
|
||||
}
|
||||
|
@ -33,11 +33,6 @@ class EntityDamageByChildEntityEvent extends EntityDamageByEntityEvent{
|
||||
private $childEntityEid;
|
||||
|
||||
/**
|
||||
* @param Entity $damager
|
||||
* @param Entity $childEntity
|
||||
* @param Entity $entity
|
||||
* @param int $cause
|
||||
* @param float $damage
|
||||
* @param float[] $modifiers
|
||||
*/
|
||||
public function __construct(Entity $damager, Entity $childEntity, Entity $entity, int $cause, float $damage, array $modifiers = []){
|
||||
@ -47,8 +42,6 @@ class EntityDamageByChildEntityEvent extends EntityDamageByEntityEvent{
|
||||
|
||||
/**
|
||||
* Returns the entity which caused the damage, or null if the entity has been killed or closed.
|
||||
*
|
||||
* @return Entity|null
|
||||
*/
|
||||
public function getChild() : ?Entity{
|
||||
return $this->getEntity()->getWorld()->getServer()->getWorldManager()->findEntity($this->childEntityEid);
|
||||
|
@ -37,12 +37,7 @@ class EntityDamageByEntityEvent extends EntityDamageEvent{
|
||||
private $knockBack;
|
||||
|
||||
/**
|
||||
* @param Entity $damager
|
||||
* @param Entity $entity
|
||||
* @param int $cause
|
||||
* @param float $damage
|
||||
* @param float[] $modifiers
|
||||
* @param float $knockBack
|
||||
*/
|
||||
public function __construct(Entity $damager, Entity $entity, int $cause, float $damage, array $modifiers = [], float $knockBack = 0.4){
|
||||
$this->damagerEntityId = $damager->getId();
|
||||
@ -66,23 +61,15 @@ class EntityDamageByEntityEvent extends EntityDamageEvent{
|
||||
|
||||
/**
|
||||
* Returns the attacking entity, or null if the attacker has been killed or closed.
|
||||
*
|
||||
* @return Entity|null
|
||||
*/
|
||||
public function getDamager() : ?Entity{
|
||||
return $this->getEntity()->getWorld()->getServer()->getWorldManager()->findEntity($this->damagerEntityId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return float
|
||||
*/
|
||||
public function getKnockBack() : float{
|
||||
return $this->knockBack;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param float $knockBack
|
||||
*/
|
||||
public function setKnockBack(float $knockBack) : void{
|
||||
$this->knockBack = $knockBack;
|
||||
}
|
||||
|
@ -76,11 +76,7 @@ class EntityDamageEvent extends EntityEvent implements Cancellable{
|
||||
/** @var int */
|
||||
private $attackCooldown = 10;
|
||||
|
||||
|
||||
/**
|
||||
* @param Entity $entity
|
||||
* @param int $cause
|
||||
* @param float $damage
|
||||
* @param float[] $modifiers
|
||||
*/
|
||||
public function __construct(Entity $entity, int $cause, float $damage, array $modifiers = []){
|
||||
@ -92,17 +88,12 @@ class EntityDamageEvent extends EntityEvent implements Cancellable{
|
||||
$this->originals = $this->modifiers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getCause() : int{
|
||||
return $this->cause;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the base amount of damage applied, before modifiers.
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getBaseDamage() : float{
|
||||
return $this->baseDamage;
|
||||
@ -112,8 +103,6 @@ class EntityDamageEvent extends EntityEvent implements Cancellable{
|
||||
* Sets the base amount of damage applied, optionally recalculating modifiers.
|
||||
*
|
||||
* TODO: add ability to recalculate modifiers when this is set
|
||||
*
|
||||
* @param float $damage
|
||||
*/
|
||||
public function setBaseDamage(float $damage) : void{
|
||||
$this->baseDamage = $damage;
|
||||
@ -121,8 +110,6 @@ class EntityDamageEvent extends EntityEvent implements Cancellable{
|
||||
|
||||
/**
|
||||
* Returns the original base amount of damage applied, before alterations by plugins.
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getOriginalBaseDamage() : float{
|
||||
return $this->originalBase;
|
||||
@ -135,11 +122,6 @@ class EntityDamageEvent extends EntityEvent implements Cancellable{
|
||||
return $this->originals;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $type
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getOriginalModifier(int $type) : float{
|
||||
return $this->originals[$type] ?? 0.0;
|
||||
}
|
||||
@ -151,42 +133,24 @@ class EntityDamageEvent extends EntityEvent implements Cancellable{
|
||||
return $this->modifiers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $type
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getModifier(int $type) : float{
|
||||
return $this->modifiers[$type] ?? 0.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param float $damage
|
||||
* @param int $type
|
||||
*/
|
||||
public function setModifier(float $damage, int $type) : void{
|
||||
$this->modifiers[$type] = $damage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $type
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isApplicable(int $type) : bool{
|
||||
return isset($this->modifiers[$type]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return float
|
||||
*/
|
||||
public function getFinalDamage() : float{
|
||||
return $this->baseDamage + array_sum($this->modifiers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether an entity can use armour points to reduce this type of damage.
|
||||
* @return bool
|
||||
*/
|
||||
public function canBeReducedByArmor() : bool{
|
||||
switch($this->cause){
|
||||
@ -207,8 +171,6 @@ class EntityDamageEvent extends EntityEvent implements Cancellable{
|
||||
|
||||
/**
|
||||
* Returns the cooldown in ticks before the target entity can be attacked again.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getAttackCooldown() : int{
|
||||
return $this->attackCooldown;
|
||||
@ -218,8 +180,6 @@ class EntityDamageEvent extends EntityEvent implements Cancellable{
|
||||
* Sets the cooldown in ticks before the target entity can be attacked again.
|
||||
*
|
||||
* NOTE: This value is not used in non-Living entities
|
||||
*
|
||||
* @param int $attackCooldown
|
||||
*/
|
||||
public function setAttackCooldown(int $attackCooldown) : void{
|
||||
$this->attackCooldown = $attackCooldown;
|
||||
|
@ -33,9 +33,7 @@ class EntityDeathEvent extends EntityEvent{
|
||||
private $xp;
|
||||
|
||||
/**
|
||||
* @param Living $entity
|
||||
* @param Item[] $drops
|
||||
* @param int $xp
|
||||
*/
|
||||
public function __construct(Living $entity, array $drops = [], int $xp = 0){
|
||||
$this->entity = $entity;
|
||||
@ -66,15 +64,12 @@ class EntityDeathEvent extends EntityEvent{
|
||||
|
||||
/**
|
||||
* Returns how much experience is dropped due to this entity's death.
|
||||
* @return int
|
||||
*/
|
||||
public function getXpDropAmount() : int{
|
||||
return $this->xp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $xp
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function setXpDropAmount(int $xp) : void{
|
||||
|
@ -30,9 +30,6 @@ use pocketmine\entity\Entity;
|
||||
*/
|
||||
class EntityDespawnEvent extends EntityEvent{
|
||||
|
||||
/**
|
||||
* @param Entity $entity
|
||||
*/
|
||||
public function __construct(Entity $entity){
|
||||
$this->entity = $entity;
|
||||
}
|
||||
|
@ -34,8 +34,6 @@ class EntityEffectAddEvent extends EntityEffectEvent{
|
||||
private $oldEffect;
|
||||
|
||||
/**
|
||||
* @param Entity $entity
|
||||
* @param EffectInstance $effect
|
||||
* @param EffectInstance $oldEffect
|
||||
*/
|
||||
public function __construct(Entity $entity, EffectInstance $effect, ?EffectInstance $oldEffect = null){
|
||||
@ -45,23 +43,15 @@ class EntityEffectAddEvent extends EntityEffectEvent{
|
||||
|
||||
/**
|
||||
* Returns whether the effect addition will replace an existing effect already applied to the entity.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function willModify() : bool{
|
||||
return $this->hasOldEffect();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasOldEffect() : bool{
|
||||
return $this->oldEffect instanceof EffectInstance;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return EffectInstance|null
|
||||
*/
|
||||
public function getOldEffect() : ?EffectInstance{
|
||||
return $this->oldEffect;
|
||||
}
|
||||
|
@ -47,10 +47,7 @@ class EntityExplodeEvent extends EntityEvent implements Cancellable{
|
||||
protected $yield;
|
||||
|
||||
/**
|
||||
* @param Entity $entity
|
||||
* @param Position $position
|
||||
* @param Block[] $blocks
|
||||
* @param float $yield
|
||||
*/
|
||||
public function __construct(Entity $entity, Position $position, array $blocks, float $yield){
|
||||
$this->entity = $entity;
|
||||
@ -59,9 +56,6 @@ class EntityExplodeEvent extends EntityEvent implements Cancellable{
|
||||
$this->yield = $yield;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Position
|
||||
*/
|
||||
public function getPosition() : Position{
|
||||
return $this->position;
|
||||
}
|
||||
@ -80,16 +74,10 @@ class EntityExplodeEvent extends EntityEvent implements Cancellable{
|
||||
$this->blocks = $blocks;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return float
|
||||
*/
|
||||
public function getYield() : float{
|
||||
return $this->yield;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param float $yield
|
||||
*/
|
||||
public function setYield(float $yield) : void{
|
||||
$this->yield = $yield;
|
||||
}
|
||||
|
@ -39,9 +39,6 @@ class EntityMotionEvent extends EntityEvent implements Cancellable{
|
||||
$this->mot = $mot;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Vector3
|
||||
*/
|
||||
public function getVector() : Vector3{
|
||||
return $this->mot;
|
||||
}
|
||||
|
@ -41,35 +41,22 @@ class EntityRegainHealthEvent extends EntityEvent implements Cancellable{
|
||||
/** @var int */
|
||||
private $reason;
|
||||
|
||||
|
||||
/**
|
||||
* @param Entity $entity
|
||||
* @param float $amount
|
||||
* @param int $regainReason
|
||||
*/
|
||||
public function __construct(Entity $entity, float $amount, int $regainReason){
|
||||
$this->entity = $entity;
|
||||
$this->amount = $amount;
|
||||
$this->reason = $regainReason;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return float
|
||||
*/
|
||||
public function getAmount() : float{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param float $amount
|
||||
*/
|
||||
public function setAmount(float $amount) : void{
|
||||
$this->amount = $amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns one of the CAUSE_* constants to indicate why this regeneration occurred.
|
||||
* @return int
|
||||
*/
|
||||
public function getRegainReason() : int{
|
||||
return $this->reason;
|
||||
|
@ -41,12 +41,6 @@ class EntityShootBowEvent extends EntityEvent implements Cancellable{
|
||||
/** @var float */
|
||||
private $force;
|
||||
|
||||
/**
|
||||
* @param Living $shooter
|
||||
* @param Item $bow
|
||||
* @param Projectile $projectile
|
||||
* @param float $force
|
||||
*/
|
||||
public function __construct(Living $shooter, Item $bow, Projectile $projectile, float $force){
|
||||
$this->entity = $shooter;
|
||||
$this->bow = $bow;
|
||||
@ -61,9 +55,6 @@ class EntityShootBowEvent extends EntityEvent implements Cancellable{
|
||||
return $this->entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Item
|
||||
*/
|
||||
public function getBow() : Item{
|
||||
return $this->bow;
|
||||
}
|
||||
@ -72,16 +63,11 @@ class EntityShootBowEvent extends EntityEvent implements Cancellable{
|
||||
* Returns the entity considered as the projectile in this event.
|
||||
*
|
||||
* NOTE: This might not return a Projectile if a plugin modified the target entity.
|
||||
*
|
||||
* @return Entity
|
||||
*/
|
||||
public function getProjectile() : Entity{
|
||||
return $this->projectile;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Entity $projectile
|
||||
*/
|
||||
public function setProjectile(Entity $projectile) : void{
|
||||
if($projectile !== $this->projectile){
|
||||
if(count($this->projectile->getViewers()) === 0){
|
||||
@ -91,16 +77,10 @@ class EntityShootBowEvent extends EntityEvent implements Cancellable{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return float
|
||||
*/
|
||||
public function getForce() : float{
|
||||
return $this->force;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param float $force
|
||||
*/
|
||||
public function setForce(float $force) : void{
|
||||
$this->force = $force;
|
||||
}
|
||||
|
@ -30,9 +30,6 @@ use pocketmine\entity\Entity;
|
||||
*/
|
||||
class EntitySpawnEvent extends EntityEvent{
|
||||
|
||||
/**
|
||||
* @param Entity $entity
|
||||
*/
|
||||
public function __construct(Entity $entity){
|
||||
$this->entity = $entity;
|
||||
}
|
||||
|
@ -42,23 +42,14 @@ class EntityTeleportEvent extends EntityEvent implements Cancellable{
|
||||
$this->to = $to;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Position
|
||||
*/
|
||||
public function getFrom() : Position{
|
||||
return $this->from;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Position
|
||||
*/
|
||||
public function getTo() : Position{
|
||||
return $this->to;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Position $to
|
||||
*/
|
||||
public function setTo(Position $to) : void{
|
||||
$this->to = $to;
|
||||
}
|
||||
|
@ -38,19 +38,12 @@ class ExplosionPrimeEvent extends EntityEvent implements Cancellable{
|
||||
/** @var bool */
|
||||
private $blockBreaking;
|
||||
|
||||
/**
|
||||
* @param Entity $entity
|
||||
* @param float $force
|
||||
*/
|
||||
public function __construct(Entity $entity, float $force){
|
||||
$this->entity = $entity;
|
||||
$this->force = $force;
|
||||
$this->blockBreaking = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return float
|
||||
*/
|
||||
public function getForce() : float{
|
||||
return $this->force;
|
||||
}
|
||||
@ -59,16 +52,10 @@ class ExplosionPrimeEvent extends EntityEvent implements Cancellable{
|
||||
$this->force = $force;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isBlockBreaking() : bool{
|
||||
return $this->blockBreaking;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $affectsBlocks
|
||||
*/
|
||||
public function setBlockBreaking(bool $affectsBlocks) : void{
|
||||
$this->blockBreaking = $affectsBlocks;
|
||||
}
|
||||
|
@ -30,9 +30,6 @@ use pocketmine\event\CancellableTrait;
|
||||
class ItemDespawnEvent extends EntityEvent implements Cancellable{
|
||||
use CancellableTrait;
|
||||
|
||||
/**
|
||||
* @param ItemEntity $item
|
||||
*/
|
||||
public function __construct(ItemEntity $item){
|
||||
$this->entity = $item;
|
||||
}
|
||||
|
@ -27,9 +27,6 @@ use pocketmine\entity\object\ItemEntity;
|
||||
|
||||
class ItemSpawnEvent extends EntityEvent{
|
||||
|
||||
/**
|
||||
* @param ItemEntity $item
|
||||
*/
|
||||
public function __construct(ItemEntity $item){
|
||||
$this->entity = $item;
|
||||
|
||||
|
@ -39,8 +39,6 @@ class ProjectileHitBlockEvent extends ProjectileHitEvent{
|
||||
/**
|
||||
* Returns the Block struck by the projectile.
|
||||
* Hint: to get the block face hit, look at the RayTraceResult.
|
||||
*
|
||||
* @return Block
|
||||
*/
|
||||
public function getBlockHit() : Block{
|
||||
return $this->blockHit;
|
||||
|
@ -38,8 +38,6 @@ class ProjectileHitEntityEvent extends ProjectileHitEvent{
|
||||
|
||||
/**
|
||||
* Returns the Entity struck by the projectile.
|
||||
*
|
||||
* @return Entity
|
||||
*/
|
||||
public function getEntityHit() : Entity{
|
||||
return $this->entityHit;
|
||||
|
@ -33,10 +33,6 @@ abstract class ProjectileHitEvent extends EntityEvent{
|
||||
/** @var RayTraceResult */
|
||||
private $rayTraceResult;
|
||||
|
||||
/**
|
||||
* @param Projectile $entity
|
||||
* @param RayTraceResult $rayTraceResult
|
||||
*/
|
||||
public function __construct(Projectile $entity, RayTraceResult $rayTraceResult){
|
||||
$this->entity = $entity;
|
||||
$this->rayTraceResult = $rayTraceResult;
|
||||
@ -52,8 +48,6 @@ abstract class ProjectileHitEvent extends EntityEvent{
|
||||
/**
|
||||
* Returns a RayTraceResult object containing information such as the exact position struck, the AABB it hit, and
|
||||
* the face of the AABB that it hit.
|
||||
*
|
||||
* @return RayTraceResult
|
||||
*/
|
||||
public function getRayTraceResult() : RayTraceResult{
|
||||
return $this->rayTraceResult;
|
||||
|
@ -30,9 +30,6 @@ use pocketmine\event\CancellableTrait;
|
||||
class ProjectileLaunchEvent extends EntityEvent implements Cancellable{
|
||||
use CancellableTrait;
|
||||
|
||||
/**
|
||||
* @param Projectile $entity
|
||||
*/
|
||||
public function __construct(Projectile $entity){
|
||||
$this->entity = $entity;
|
||||
}
|
||||
|
Reference in New Issue
Block a user