mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Typehints on missed sound and particle APIs
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user