Sound no longer extends Vector3

This commit is contained in:
Dylan K. Taylor
2018-12-16 14:26:42 +00:00
parent 3c520aa786
commit 20aaa8373a
23 changed files with 48 additions and 61 deletions

View File

@ -450,15 +450,15 @@ class Level implements ChunkManager, Metadatable{
$this->closed = true;
}
public function addSound(Sound $sound, array $players = null){
$pk = $sound->encode();
public function addSound(Vector3 $pos, Sound $sound, array $players = null){
$pk = $sound->encode($pos);
if(!is_array($pk)){
$pk = [$pk];
}
if(!empty($pk)){
if($players === null){
foreach($pk as $e){
$this->broadcastPacketToViewers($sound, $e);
$this->broadcastPacketToViewers($pos, $e);
}
}else{
$this->server->broadcastPackets($players, $pk);