From 9f49060ae6a40e8ca9374096c93538c2800710a5 Mon Sep 17 00:00:00 2001 From: stujones11 Date: Sun, 18 Feb 2018 20:35:49 +0000 Subject: [PATCH] Shields: Add option to disable sound effects --- shields/README.txt | 7 +++++++ shields/init.lua | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/shields/README.txt b/shields/README.txt index d71626d..5a72097 100644 --- a/shields/README.txt +++ b/shields/README.txt @@ -7,3 +7,10 @@ Depends: 3d_armor Originally a part of 3d_armor, shields have been re-included as an optional extra. If you do not what shields then simply remove the shields folder from the modpack. + +Shields Configuration +--------------------- + +Override the following default settings by adding them to your minetest.conf file. + +shields_disable_sounds = false diff --git a/shields/init.lua b/shields/init.lua index 5ffaf1b..0b4f87e 100644 --- a/shields/init.lua +++ b/shields/init.lua @@ -8,9 +8,11 @@ if minetest.global_exists("intllib") then S = intllib.Getter() end end + +local disable_sounds = minetest.settings:get_bool("shields_disable_sounds") local use_moreores = minetest.get_modpath("moreores") local function play_sound_effect(player, name) - if player then + if not disable_sounds and player then local pos = player:getpos() if pos then minetest.sound_play(name, {