addSound() public method

public addSound ( Sound $sound, array $players = null )
$sound pocketmine\level\sound\Sound
$players array
Exemplo n.º 1
0
 public function startGame()
 {
     $this->game = 2;
     $msg = Messages::getMsg("started", ["%NAME", $this->name]);
     $sound = new AnvilUseSound(new Vector3());
     foreach ($this->players as $p) {
         /** @var Player $pl */
         $pl = $p["ins"];
         $pl->sendMessage($msg);
         $sound->setComponents($pl->x, $pl->y, $pl->z);
         $this->level->addSound($sound, [$pl]);
     }
 }