mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-09 03:06:55 +00:00
remove LevelEventSound, remove pitch from sounds that don't support it (most of them)
This commit is contained in:
@ -23,11 +23,26 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\world\sound;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\mcpe\protocol\LevelEventPacket;
|
||||
|
||||
class FizzSound extends LevelEventSound{
|
||||
class FizzSound implements Sound{
|
||||
|
||||
protected function getLevelEventId() : int{
|
||||
return LevelEventPacket::EVENT_SOUND_FIZZ;
|
||||
/** @var float */
|
||||
private $pitch;
|
||||
|
||||
public function __construct(float $pitch = 0){
|
||||
$this->pitch = $pitch;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return float
|
||||
*/
|
||||
public function getPitch() : float{
|
||||
return $this->pitch;
|
||||
}
|
||||
|
||||
public function encode(?Vector3 $pos){
|
||||
return LevelEventPacket::create(LevelEventPacket::EVENT_SOUND_FIZZ, (int) ($this->pitch * 1000), $pos);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user