mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-28 06:09:57 +00:00
Found an unknown field in LevelSoundEventPacket
This commit is contained in:
parent
702c129a97
commit
c383c7b0dd
@ -516,12 +516,16 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
* @param int $soundId
|
* @param int $soundId
|
||||||
* @param int $pitch
|
* @param int $pitch
|
||||||
* @param int $extraData
|
* @param int $extraData
|
||||||
|
* @param bool $unknown
|
||||||
|
* @param bool $disableRelativeVolume If true, all players receiving this sound-event will hear the sound at full volume regardless of distance
|
||||||
*/
|
*/
|
||||||
public function broadcastLevelSoundEvent(Vector3 $pos, int $soundId, int $pitch = 1, int $extraData = -1){
|
public function broadcastLevelSoundEvent(Vector3 $pos, int $soundId, int $pitch = 1, int $extraData = -1, bool $unknown = false, bool $disableRelativeVolume = false){
|
||||||
$pk = new LevelSoundEventPacket();
|
$pk = new LevelSoundEventPacket();
|
||||||
$pk->sound = $soundId;
|
$pk->sound = $soundId;
|
||||||
$pk->pitch = $pitch;
|
$pk->pitch = $pitch;
|
||||||
$pk->extraData = $extraData;
|
$pk->extraData = $extraData;
|
||||||
|
$pk->unknownBool = $unknown;
|
||||||
|
$pk->disableRelativeVolume = $disableRelativeVolume;
|
||||||
list($pk->x, $pk->y, $pk->z) = [$pos->x, $pos->y, $pos->z];
|
list($pk->x, $pk->y, $pk->z) = [$pos->x, $pos->y, $pos->z];
|
||||||
$this->addChunkPacket($pos->x >> 4, $pos->z >> 4, $pk);
|
$this->addChunkPacket($pos->x >> 4, $pos->z >> 4, $pk);
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,7 @@ class LevelSoundEventPacket extends DataPacket{
|
|||||||
public $extraData = -1;
|
public $extraData = -1;
|
||||||
public $pitch = 1;
|
public $pitch = 1;
|
||||||
public $unknownBool = false;
|
public $unknownBool = false;
|
||||||
public $unknownBool2 = false;
|
public $disableRelativeVolume = false;
|
||||||
|
|
||||||
public function decode(){
|
public function decode(){
|
||||||
$this->sound = $this->getByte();
|
$this->sound = $this->getByte();
|
||||||
@ -142,7 +142,7 @@ class LevelSoundEventPacket extends DataPacket{
|
|||||||
$this->extraData = $this->getVarInt();
|
$this->extraData = $this->getVarInt();
|
||||||
$this->pitch = $this->getVarInt();
|
$this->pitch = $this->getVarInt();
|
||||||
$this->unknownBool = $this->getBool();
|
$this->unknownBool = $this->getBool();
|
||||||
$this->unknownBool2 = $this->getBool();
|
$this->disableRelativeVolume = $this->getBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function encode(){
|
public function encode(){
|
||||||
@ -152,7 +152,7 @@ class LevelSoundEventPacket extends DataPacket{
|
|||||||
$this->putVarInt($this->extraData);
|
$this->putVarInt($this->extraData);
|
||||||
$this->putVarInt($this->pitch);
|
$this->putVarInt($this->pitch);
|
||||||
$this->putBool($this->unknownBool);
|
$this->putBool($this->unknownBool);
|
||||||
$this->putBool($this->unknownBool2);
|
$this->putBool($this->disableRelativeVolume);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handle(NetworkSession $session) : bool{
|
public function handle(NetworkSession $session) : bool{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user