From 332ffbca08568f13ffef9b5dbc3bad81ededf3b9 Mon Sep 17 00:00:00 2001 From: Romain Beaumont Date: Sun, 20 May 2018 16:43:43 +0200 Subject: [PATCH] add soundCategory to named_sound_effect sending --- src/lib/plugins/sound.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/plugins/sound.js b/src/lib/plugins/sound.js index bdefa67..9cfccf1 100644 --- a/src/lib/plugins/sound.js +++ b/src/lib/plugins/sound.js @@ -1,7 +1,7 @@ const Vec3 = require('vec3').Vec3 module.exports.server = function (serv) { - serv.playSound = (sound, world, position, {whitelist, blacklist = [], radius = 32 * 32, volume = 1.0, pitch = 1.0} = {}) => { + serv.playSound = (sound, world, position, {whitelist, blacklist = [], radius = 32 * 32, volume = 1.0, pitch = 1.0, soundCategory = 0} = {}) => { const players = (typeof whitelist !== 'undefined' ? (typeof whitelist instanceof Array ? whitelist : [whitelist]) : serv.getNearby({ world: world, position: position.scaled(32).floored(), @@ -12,6 +12,7 @@ module.exports.server = function (serv) { const pos = (position || player.position.scaled(1 / 32)).scaled(8).floored() player._client.write('named_sound_effect', { soundName: sound, + soundCategory, x: pos.x, y: pos.y, z: pos.z,