mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-04 00:55:14 +00:00
Hinting up Entity API to PHP 7.2 standards
This commit is contained in:
@ -55,20 +55,20 @@ abstract class Projectile extends Entity{
|
||||
/** @var int|null */
|
||||
protected $blockHitData;
|
||||
|
||||
public function __construct(Level $level, CompoundTag $nbt, Entity $shootingEntity = null){
|
||||
public function __construct(Level $level, CompoundTag $nbt, ?Entity $shootingEntity = null){
|
||||
parent::__construct($level, $nbt);
|
||||
if($shootingEntity !== null){
|
||||
$this->setOwningEntity($shootingEntity);
|
||||
}
|
||||
}
|
||||
|
||||
public function attack(EntityDamageEvent $source){
|
||||
public function attack(EntityDamageEvent $source) : void{
|
||||
if($source->getCause() === EntityDamageEvent::CAUSE_VOID){
|
||||
parent::attack($source);
|
||||
}
|
||||
}
|
||||
|
||||
protected function initEntity(){
|
||||
protected function initEntity() : void{
|
||||
parent::initEntity();
|
||||
|
||||
$this->setMaxHealth(1);
|
||||
@ -120,7 +120,7 @@ abstract class Projectile extends Entity{
|
||||
return (int) ceil(sqrt($this->motionX ** 2 + $this->motionY ** 2 + $this->motionZ ** 2) * $this->damage);
|
||||
}
|
||||
|
||||
public function saveNBT(){
|
||||
public function saveNBT() : void{
|
||||
parent::saveNBT();
|
||||
|
||||
$this->namedtag->setShort("Age", $this->age);
|
||||
|
Reference in New Issue
Block a user