From 71be25f44aa074929a28265add78bf84e86f79fe Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 21 Nov 2017 06:03:07 +0100 Subject: [PATCH] Only play tele sound for players --- mods/ITEMS/mcl_portals/portal_end.lua | 2 +- mods/ITEMS/mcl_portals/portal_nether.lua | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_portals/portal_end.lua b/mods/ITEMS/mcl_portals/portal_end.lua index 9e59bbc7..746cf6f7 100644 --- a/mods/ITEMS/mcl_portals/portal_end.lua +++ b/mods/ITEMS/mcl_portals/portal_end.lua @@ -339,8 +339,8 @@ minetest.register_abm({ -- Look towards the End island if obj:is_player() and dim ~= "end" then obj:set_look_horizontal(math.pi/2) + minetest.sound_play("mcl_portals_teleport", {pos=target, gain=0.5, max_hear_distance = 16}) end - minetest.sound_play("mcl_portals_teleport", {pos=target, gain=0.5, max_hear_distance = 16}) end end end, diff --git a/mods/ITEMS/mcl_portals/portal_nether.lua b/mods/ITEMS/mcl_portals/portal_nether.lua index f469642c..74f089ac 100644 --- a/mods/ITEMS/mcl_portals/portal_nether.lua +++ b/mods/ITEMS/mcl_portals/portal_nether.lua @@ -434,7 +434,9 @@ minetest.register_abm({ -- Teleport obj:setpos(target) - minetest.sound_play("mcl_portals_teleport", {pos=target, gain=0.5, max_hear_distance = 16}) + if obj:is_player() then + minetest.sound_play("mcl_portals_teleport", {pos=target, gain=0.5, max_hear_distance = 16}) + end -- Enable teleportation cooloff for 4 seconds, to prevent back-and-forth teleportation portal_cooloff[obj] = true