LevelSoundEventPacket: more helpers

This commit is contained in:
Dylan K. Taylor
2019-03-26 18:14:33 +00:00
parent 10db57655e
commit e1504c668e
2 changed files with 24 additions and 10 deletions

View File

@ -285,6 +285,17 @@ class LevelSoundEventPacket extends DataPacket implements ClientboundPacket, Ser
public const SOUND_CANT_BREED = 254;
public const SOUND_UNDEFINED = 255;
public static function create(int $sound, int $extraData, ?Vector3 $pos, string $entityType = ":", bool $isBabyMob = false) : self{
$result = new self;
$result->sound = $sound;
$result->extraData = $extraData;
$result->position = $pos;
$result->disableRelativeVolume = $pos === null;
$result->entityType = $entityType;
$result->isBabyMob = $isBabyMob;
return $result;
}
/** @var int */
public $sound;
/** @var Vector3 */