New fields for LevelSoundEventPacket (previously unknown)

This commit is contained in:
Dylan K. Taylor 2016-10-04 22:03:02 +01:00
parent 08f11412a4
commit e35ed7f04a

View File

@ -25,14 +25,13 @@ namespace pocketmine\network\protocol;
class LevelSoundEventPacket extends DataPacket{ class LevelSoundEventPacket extends DataPacket{
const NETWORK_ID = Info::LEVEL_SOUND_EVENT_PACKET; const NETWORK_ID = Info::LEVEL_SOUND_EVENT_PACKET;
//TODO: find unknowns public $sound;
public $unknownByte;
public $x; public $x;
public $y; public $y;
public $z; public $z;
public $unknownVarInt1; public $volume;
public $unknownVarInt2; public $pitch;
public $unknownBool; public $unknownBool;
public function decode(){ public function decode(){
@ -41,10 +40,10 @@ class LevelSoundEventPacket extends DataPacket{
public function encode(){ public function encode(){
$this->reset(); $this->reset();
$this->putByte($this->unknownByte); $this->putByte($this->sound);
$this->putVector3f($this->x, $this->y, $this->z); $this->putVector3f($this->x, $this->y, $this->z);
$this->putVarInt($this->unknownVarInt1); $this->putVarInt($this->volume);
$this->putVarInt($this->unknownVarInt2); $this->putVarInt($this->pitch);
$this->putByte($this->unknownBool); $this->putByte($this->unknownBool);
} }
} }