Merge branch 'php/7.0' into mcpe-1.2

This commit is contained in:
Dylan K. Taylor
2017-09-01 23:10:58 +01:00
54 changed files with 462 additions and 382 deletions

View File

@@ -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);
}