Typehints on missed sound and particle APIs

This commit is contained in:
Dylan K. Taylor
2018-05-02 11:44:18 +01:00
parent b4068dfd2f
commit d80c471ae1
23 changed files with 38 additions and 35 deletions

View File

@ -26,7 +26,7 @@ namespace pocketmine\level\particle;
use pocketmine\math\Vector3;
class CriticalParticle extends GenericParticle{
public function __construct(Vector3 $pos, $scale = 2){
public function __construct(Vector3 $pos, int $scale = 2){
parent::__construct($pos, Particle::TYPE_CRITICAL, $scale);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\level\particle;
use pocketmine\math\Vector3;
class DustParticle extends GenericParticle{
public function __construct(Vector3 $pos, $r, $g, $b, $a = 255){
public function __construct(Vector3 $pos, int $r, int $g, int $b, int $a = 255){
parent::__construct($pos, Particle::TYPE_DUST, (($a & 0xff) << 24) | (($r & 0xff) << 16) | (($g & 0xff) << 8) | ($b & 0xff));
}
}

View File

@ -72,7 +72,7 @@ class FloatingTextParticle extends Particle{
return $this->invisible;
}
public function setInvisible(bool $value = true){
public function setInvisible(bool $value = true) : void{
$this->invisible = $value;
}

View File

@ -27,11 +27,12 @@ use pocketmine\math\Vector3;
use pocketmine\network\mcpe\protocol\LevelEventPacket;
class GenericParticle extends Particle{
/** @var int */
protected $id;
/** @var int */
protected $data;
public function __construct(Vector3 $pos, $id, $data = 0){
public function __construct(Vector3 $pos, int $id, int $data = 0){
parent::__construct($pos->x, $pos->y, $pos->z);
$this->id = $id & 0xFFF;
$this->data = $data;

View File

@ -26,7 +26,7 @@ namespace pocketmine\level\particle;
use pocketmine\math\Vector3;
class HeartParticle extends GenericParticle{
public function __construct(Vector3 $pos, $scale = 0){
public function __construct(Vector3 $pos, int $scale = 0){
parent::__construct($pos, Particle::TYPE_HEART, $scale);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\level\particle;
use pocketmine\math\Vector3;
class InkParticle extends GenericParticle{
public function __construct(Vector3 $pos, $scale = 0){
public function __construct(Vector3 $pos, int $scale = 0){
parent::__construct($pos, Particle::TYPE_INK, $scale);
}
}

View File

@ -27,11 +27,12 @@ use pocketmine\math\Vector3;
use pocketmine\network\mcpe\protocol\LevelEventPacket;
class MobSpawnParticle extends Particle{
/** @var int */
protected $width;
/** @var int */
protected $height;
public function __construct(Vector3 $pos, $width = 0, $height = 0){
public function __construct(Vector3 $pos, int $width = 0, int $height = 0){
parent::__construct($pos->x, $pos->y, $pos->z);
$this->width = $width;
$this->height = $height;

View File

@ -26,7 +26,7 @@ namespace pocketmine\level\particle;
use pocketmine\math\Vector3;
class RedstoneParticle extends GenericParticle{
public function __construct(Vector3 $pos, $lifetime = 1){
public function __construct(Vector3 $pos, int $lifetime = 1){
parent::__construct($pos, Particle::TYPE_REDSTONE, $lifetime);
}
}

View File

@ -26,7 +26,7 @@ namespace pocketmine\level\particle;
use pocketmine\math\Vector3;
class SmokeParticle extends GenericParticle{
public function __construct(Vector3 $pos, $scale = 0){
parent::__construct($pos, Particle::TYPE_SMOKE, (int) $scale);
public function __construct(Vector3 $pos, int $scale = 0){
parent::__construct($pos, Particle::TYPE_SMOKE, $scale);
}
}