diff --git a/src/pocketmine/level/particle/CriticalParticle.php b/src/pocketmine/level/particle/CriticalParticle.php index 895b500ab..9ecfff529 100644 --- a/src/pocketmine/level/particle/CriticalParticle.php +++ b/src/pocketmine/level/particle/CriticalParticle.php @@ -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); } } diff --git a/src/pocketmine/level/particle/DustParticle.php b/src/pocketmine/level/particle/DustParticle.php index 5144f02c2..e1cb56742 100644 --- a/src/pocketmine/level/particle/DustParticle.php +++ b/src/pocketmine/level/particle/DustParticle.php @@ -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)); } } diff --git a/src/pocketmine/level/particle/FloatingTextParticle.php b/src/pocketmine/level/particle/FloatingTextParticle.php index 725f56b7b..f9e460388 100644 --- a/src/pocketmine/level/particle/FloatingTextParticle.php +++ b/src/pocketmine/level/particle/FloatingTextParticle.php @@ -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; } diff --git a/src/pocketmine/level/particle/GenericParticle.php b/src/pocketmine/level/particle/GenericParticle.php index 156a2a501..b14afa149 100644 --- a/src/pocketmine/level/particle/GenericParticle.php +++ b/src/pocketmine/level/particle/GenericParticle.php @@ -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; diff --git a/src/pocketmine/level/particle/HeartParticle.php b/src/pocketmine/level/particle/HeartParticle.php index f7dfb80a3..c25271b1d 100644 --- a/src/pocketmine/level/particle/HeartParticle.php +++ b/src/pocketmine/level/particle/HeartParticle.php @@ -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); } } diff --git a/src/pocketmine/level/particle/InkParticle.php b/src/pocketmine/level/particle/InkParticle.php index c794af312..80fed048f 100644 --- a/src/pocketmine/level/particle/InkParticle.php +++ b/src/pocketmine/level/particle/InkParticle.php @@ -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); } } diff --git a/src/pocketmine/level/particle/MobSpawnParticle.php b/src/pocketmine/level/particle/MobSpawnParticle.php index 62498c067..754e59710 100644 --- a/src/pocketmine/level/particle/MobSpawnParticle.php +++ b/src/pocketmine/level/particle/MobSpawnParticle.php @@ -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; diff --git a/src/pocketmine/level/particle/RedstoneParticle.php b/src/pocketmine/level/particle/RedstoneParticle.php index 8db6157d8..7fa524115 100644 --- a/src/pocketmine/level/particle/RedstoneParticle.php +++ b/src/pocketmine/level/particle/RedstoneParticle.php @@ -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); } } diff --git a/src/pocketmine/level/particle/SmokeParticle.php b/src/pocketmine/level/particle/SmokeParticle.php index 99ae52187..3653551f9 100644 --- a/src/pocketmine/level/particle/SmokeParticle.php +++ b/src/pocketmine/level/particle/SmokeParticle.php @@ -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); } } diff --git a/src/pocketmine/level/sound/AnvilBreakSound.php b/src/pocketmine/level/sound/AnvilBreakSound.php index 877a4f4a3..c144d8833 100644 --- a/src/pocketmine/level/sound/AnvilBreakSound.php +++ b/src/pocketmine/level/sound/AnvilBreakSound.php @@ -27,7 +27,7 @@ use pocketmine\math\Vector3; use pocketmine\network\mcpe\protocol\LevelEventPacket; class AnvilBreakSound extends GenericSound{ - public function __construct(Vector3 $pos, $pitch = 0){ + public function __construct(Vector3 $pos, float $pitch = 0){ parent::__construct($pos, LevelEventPacket::EVENT_SOUND_ANVIL_BREAK, $pitch); } } diff --git a/src/pocketmine/level/sound/AnvilFallSound.php b/src/pocketmine/level/sound/AnvilFallSound.php index 641722443..a1bb8ce17 100644 --- a/src/pocketmine/level/sound/AnvilFallSound.php +++ b/src/pocketmine/level/sound/AnvilFallSound.php @@ -27,7 +27,7 @@ use pocketmine\math\Vector3; use pocketmine\network\mcpe\protocol\LevelEventPacket; class AnvilFallSound extends GenericSound{ - public function __construct(Vector3 $pos, $pitch = 0){ + public function __construct(Vector3 $pos, float $pitch = 0){ parent::__construct($pos, LevelEventPacket::EVENT_SOUND_ANVIL_FALL, $pitch); } } diff --git a/src/pocketmine/level/sound/AnvilUseSound.php b/src/pocketmine/level/sound/AnvilUseSound.php index e3f501563..7036e7113 100644 --- a/src/pocketmine/level/sound/AnvilUseSound.php +++ b/src/pocketmine/level/sound/AnvilUseSound.php @@ -27,7 +27,7 @@ use pocketmine\math\Vector3; use pocketmine\network\mcpe\protocol\LevelEventPacket; class AnvilUseSound extends GenericSound{ - public function __construct(Vector3 $pos, $pitch = 0){ + public function __construct(Vector3 $pos, float $pitch = 0){ parent::__construct($pos, LevelEventPacket::EVENT_SOUND_ANVIL_USE, $pitch); } } diff --git a/src/pocketmine/level/sound/BlazeShootSound.php b/src/pocketmine/level/sound/BlazeShootSound.php index 1e5f47875..2da36d25b 100644 --- a/src/pocketmine/level/sound/BlazeShootSound.php +++ b/src/pocketmine/level/sound/BlazeShootSound.php @@ -27,7 +27,7 @@ use pocketmine\math\Vector3; use pocketmine\network\mcpe\protocol\LevelEventPacket; class BlazeShootSound extends GenericSound{ - public function __construct(Vector3 $pos, $pitch = 0){ + public function __construct(Vector3 $pos, float $pitch = 0){ parent::__construct($pos, LevelEventPacket::EVENT_SOUND_BLAZE_SHOOT, $pitch); } } diff --git a/src/pocketmine/level/sound/ClickSound.php b/src/pocketmine/level/sound/ClickSound.php index e103b0e91..9ca035309 100644 --- a/src/pocketmine/level/sound/ClickSound.php +++ b/src/pocketmine/level/sound/ClickSound.php @@ -27,7 +27,7 @@ use pocketmine\math\Vector3; use pocketmine\network\mcpe\protocol\LevelEventPacket; class ClickSound extends GenericSound{ - public function __construct(Vector3 $pos, $pitch = 0){ + public function __construct(Vector3 $pos, float $pitch = 0){ parent::__construct($pos, LevelEventPacket::EVENT_SOUND_CLICK, $pitch); } } diff --git a/src/pocketmine/level/sound/DoorBumpSound.php b/src/pocketmine/level/sound/DoorBumpSound.php index cd865ecea..0035b1ef7 100644 --- a/src/pocketmine/level/sound/DoorBumpSound.php +++ b/src/pocketmine/level/sound/DoorBumpSound.php @@ -27,7 +27,7 @@ use pocketmine\math\Vector3; use pocketmine\network\mcpe\protocol\LevelEventPacket; class DoorBumpSound extends GenericSound{ - public function __construct(Vector3 $pos, $pitch = 0){ + public function __construct(Vector3 $pos, float $pitch = 0){ parent::__construct($pos, LevelEventPacket::EVENT_SOUND_DOOR_BUMP, $pitch); } } diff --git a/src/pocketmine/level/sound/DoorCrashSound.php b/src/pocketmine/level/sound/DoorCrashSound.php index 98a626059..e9e817b4b 100644 --- a/src/pocketmine/level/sound/DoorCrashSound.php +++ b/src/pocketmine/level/sound/DoorCrashSound.php @@ -27,7 +27,7 @@ use pocketmine\math\Vector3; use pocketmine\network\mcpe\protocol\LevelEventPacket; class DoorCrashSound extends GenericSound{ - public function __construct(Vector3 $pos, $pitch = 0){ + public function __construct(Vector3 $pos, float $pitch = 0){ parent::__construct($pos, LevelEventPacket::EVENT_SOUND_DOOR_CRASH, $pitch); } } diff --git a/src/pocketmine/level/sound/DoorSound.php b/src/pocketmine/level/sound/DoorSound.php index c7b0919c8..2da8ed919 100644 --- a/src/pocketmine/level/sound/DoorSound.php +++ b/src/pocketmine/level/sound/DoorSound.php @@ -27,7 +27,7 @@ use pocketmine\math\Vector3; use pocketmine\network\mcpe\protocol\LevelEventPacket; class DoorSound extends GenericSound{ - public function __construct(Vector3 $pos, $pitch = 0){ + public function __construct(Vector3 $pos, float $pitch = 0){ parent::__construct($pos, LevelEventPacket::EVENT_SOUND_DOOR, $pitch); } } diff --git a/src/pocketmine/level/sound/FizzSound.php b/src/pocketmine/level/sound/FizzSound.php index 708b3f533..944f9b746 100644 --- a/src/pocketmine/level/sound/FizzSound.php +++ b/src/pocketmine/level/sound/FizzSound.php @@ -27,7 +27,7 @@ use pocketmine\math\Vector3; use pocketmine\network\mcpe\protocol\LevelEventPacket; class FizzSound extends GenericSound{ - public function __construct(Vector3 $pos, $pitch = 0){ + public function __construct(Vector3 $pos, float $pitch = 0){ parent::__construct($pos, LevelEventPacket::EVENT_SOUND_FIZZ, $pitch); } } diff --git a/src/pocketmine/level/sound/GenericSound.php b/src/pocketmine/level/sound/GenericSound.php index c7071d2ea..cb9099854 100644 --- a/src/pocketmine/level/sound/GenericSound.php +++ b/src/pocketmine/level/sound/GenericSound.php @@ -28,24 +28,25 @@ use pocketmine\network\mcpe\protocol\LevelEventPacket; class GenericSound extends Sound{ - public function __construct(Vector3 $pos, $id, $pitch = 0){ + /** @var int */ + protected $id; + /** @var float */ + protected $pitch = 0; + + public function __construct(Vector3 $pos, int $id, float $pitch = 0){ parent::__construct($pos->x, $pos->y, $pos->z); - $this->id = (int) $id; - $this->pitch = (float) $pitch * 1000; + $this->id = $id; + $this->pitch = $pitch * 1000; } - protected $pitch = 0; - protected $id; - - public function getPitch(){ + public function getPitch() : float{ return $this->pitch / 1000; } - public function setPitch($pitch){ - $this->pitch = (float) $pitch * 1000; + public function setPitch(float $pitch) : void{ + $this->pitch = $pitch * 1000; } - public function encode(){ $pk = new LevelEventPacket; $pk->evid = $this->id; diff --git a/src/pocketmine/level/sound/GhastShootSound.php b/src/pocketmine/level/sound/GhastShootSound.php index 0e4566e15..09000042e 100644 --- a/src/pocketmine/level/sound/GhastShootSound.php +++ b/src/pocketmine/level/sound/GhastShootSound.php @@ -27,7 +27,7 @@ use pocketmine\math\Vector3; use pocketmine\network\mcpe\protocol\LevelEventPacket; class GhastShootSound extends GenericSound{ - public function __construct(Vector3 $pos, $pitch = 0){ + public function __construct(Vector3 $pos, float $pitch = 0){ parent::__construct($pos, LevelEventPacket::EVENT_SOUND_GHAST_SHOOT, $pitch); } } diff --git a/src/pocketmine/level/sound/GhastSound.php b/src/pocketmine/level/sound/GhastSound.php index 1a18cec09..cef339b38 100644 --- a/src/pocketmine/level/sound/GhastSound.php +++ b/src/pocketmine/level/sound/GhastSound.php @@ -27,7 +27,7 @@ use pocketmine\math\Vector3; use pocketmine\network\mcpe\protocol\LevelEventPacket; class GhastSound extends GenericSound{ - public function __construct(Vector3 $pos, $pitch = 0){ + public function __construct(Vector3 $pos, float $pitch = 0){ parent::__construct($pos, LevelEventPacket::EVENT_SOUND_GHAST, $pitch); } } diff --git a/src/pocketmine/level/sound/LaunchSound.php b/src/pocketmine/level/sound/LaunchSound.php index a5a2170c5..2ad2e3bfd 100644 --- a/src/pocketmine/level/sound/LaunchSound.php +++ b/src/pocketmine/level/sound/LaunchSound.php @@ -27,7 +27,7 @@ use pocketmine\math\Vector3; use pocketmine\network\mcpe\protocol\LevelEventPacket; class LaunchSound extends GenericSound{ - public function __construct(Vector3 $pos, $pitch = 0){ + public function __construct(Vector3 $pos, float $pitch = 0){ parent::__construct($pos, LevelEventPacket::EVENT_SOUND_SHOOT, $pitch); } } diff --git a/src/pocketmine/level/sound/PopSound.php b/src/pocketmine/level/sound/PopSound.php index ee514c111..adb768ac6 100644 --- a/src/pocketmine/level/sound/PopSound.php +++ b/src/pocketmine/level/sound/PopSound.php @@ -27,7 +27,7 @@ use pocketmine\math\Vector3; use pocketmine\network\mcpe\protocol\LevelEventPacket; class PopSound extends GenericSound{ - public function __construct(Vector3 $pos, $pitch = 0){ + public function __construct(Vector3 $pos, float $pitch = 0){ parent::__construct($pos, LevelEventPacket::EVENT_SOUND_POP, $pitch); } }