mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +00:00
New fields for PlaySoundPacket and StopSoundPacket
This commit is contained in:
parent
0a4d62b405
commit
fe3b5bac51
@ -30,26 +30,26 @@ use pocketmine\network\mcpe\NetworkSession;
|
||||
class PlaySoundPacket extends DataPacket{
|
||||
const NETWORK_ID = ProtocolInfo::PLAY_SOUND_PACKET;
|
||||
|
||||
public $string1;
|
||||
public $soundName;
|
||||
public $x;
|
||||
public $y;
|
||||
public $z;
|
||||
public $float1;
|
||||
public $float2;
|
||||
public $volume;
|
||||
public $pitch;
|
||||
|
||||
public function decode(){
|
||||
$this->string1 = $this->getString();
|
||||
$this->soundName = $this->getString();
|
||||
$this->getBlockPosition($this->x, $this->y, $this->z);
|
||||
$this->float1 = $this->getLFloat();
|
||||
$this->float2 = $this->getLFloat();
|
||||
$this->volume = $this->getLFloat();
|
||||
$this->pitch = $this->getLFloat();
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putString($this->string1);
|
||||
$this->putString($this->soundName);
|
||||
$this->putBlockPosition($this->x, $this->y, $this->z);
|
||||
$this->putLFloat($this->float1);
|
||||
$this->putLFloat($this->float2);
|
||||
$this->putLFloat($this->volume);
|
||||
$this->putLFloat($this->pitch);
|
||||
}
|
||||
|
||||
public function handle(NetworkSession $session) : bool{
|
||||
|
@ -30,17 +30,17 @@ use pocketmine\network\mcpe\NetworkSession;
|
||||
class StopSoundPacket extends DataPacket{
|
||||
const NETWORK_ID = ProtocolInfo::STOP_SOUND_PACKET;
|
||||
|
||||
public $string1;
|
||||
public $soundName;
|
||||
public $stopAll;
|
||||
|
||||
public function decode(){
|
||||
$this->string1 = $this->getString();
|
||||
$this->soundName = $this->getString();
|
||||
$this->stopAll = $this->getBool();
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putString($this->string1);
|
||||
$this->putString($this->soundName);
|
||||
$this->putBool($this->stopAll);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user