mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-19 04:15:04 +00:00
Merge branch 'php/7.0' into mcpe-1.2
This commit is contained in:
@@ -34,11 +34,11 @@ class PlaySoundPacket extends DataPacket{
|
||||
|
||||
/** @var string */
|
||||
public $soundName;
|
||||
/** @var int */
|
||||
/** @var float */
|
||||
public $x;
|
||||
/** @var int */
|
||||
/** @var float */
|
||||
public $y;
|
||||
/** @var int */
|
||||
/** @var float */
|
||||
public $z;
|
||||
/** @var float */
|
||||
public $volume;
|
||||
@@ -48,13 +48,16 @@ class PlaySoundPacket extends DataPacket{
|
||||
protected function decodePayload(){
|
||||
$this->soundName = $this->getString();
|
||||
$this->getBlockPosition($this->x, $this->y, $this->z);
|
||||
$this->x /= 8;
|
||||
$this->y /= 8;
|
||||
$this->z /= 8;
|
||||
$this->volume = $this->getLFloat();
|
||||
$this->pitch = $this->getLFloat();
|
||||
}
|
||||
|
||||
protected function encodePayload(){
|
||||
$this->putString($this->soundName);
|
||||
$this->putBlockPosition($this->x, $this->y, $this->z);
|
||||
$this->putBlockPosition((int) ($this->x * 8), (int) ($this->y * 8), (int) ($this->z * 8));
|
||||
$this->putLFloat($this->volume);
|
||||
$this->putLFloat($this->pitch);
|
||||
}
|
||||
|
Reference in New Issue
Block a user