mirror of
https://github.com/danbulant/flying-squid
synced 2026-06-24 17:21:43 +00:00
add soundCategory to named_sound_effect sending
This commit is contained in:
parent
483dafb679
commit
332ffbca08
1 changed files with 2 additions and 1 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
const Vec3 = require('vec3').Vec3
|
const Vec3 = require('vec3').Vec3
|
||||||
|
|
||||||
module.exports.server = function (serv) {
|
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({
|
const players = (typeof whitelist !== 'undefined' ? (typeof whitelist instanceof Array ? whitelist : [whitelist]) : serv.getNearby({
|
||||||
world: world,
|
world: world,
|
||||||
position: position.scaled(32).floored(),
|
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()
|
const pos = (position || player.position.scaled(1 / 32)).scaled(8).floored()
|
||||||
player._client.write('named_sound_effect', {
|
player._client.write('named_sound_effect', {
|
||||||
soundName: sound,
|
soundName: sound,
|
||||||
|
soundCategory,
|
||||||
x: pos.x,
|
x: pos.x,
|
||||||
y: pos.y,
|
y: pos.y,
|
||||||
z: pos.z,
|
z: pos.z,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue