play sounds, remove chat feedback

This commit is contained in:
Tai @ Flex 2016-08-18 20:47:32 +01:00
parent b574d865e7
commit 50a29015d4

View File

@ -28,10 +28,10 @@ minetest.register_tool("vivarium:staff_stack", { -- this will be the wall staff
local relpos = (userpos.y - pos.y)/math.sqrt((userpos.y - pos.y)^2) local relpos = (userpos.y - pos.y)/math.sqrt((userpos.y - pos.y)^2)
local lower = 0 ; local higher = 0 local lower = 0 ; local higher = 0
if relpos < 0 then if relpos < 0 then
minetest.chat_send_player(pname, "Stack down") -- minetest.chat_send_player(pname, "Stack down")
lower = -1*height lower = -1*height
elseif relpos > 0 then elseif relpos > 0 then
minetest.chat_send_player(pname, "Stack up") -- minetest.chat_send_player(pname, "Stack up")
higher = height higher = height
end end
@ -40,6 +40,10 @@ minetest.register_tool("vivarium:staff_stack", { -- this will be the wall staff
{x = pos.x, y = pos.y+higher, z = pos.z}, {x = pos.x, y = pos.y+higher, z = pos.z},
{"air"} {"air"}
) )
minetest.sound_play("vivarium_pom", {
pos = pos,
max_hear_distance = 10
})
for _,fpos in pairs(airnodes) do for _,fpos in pairs(airnodes) do
minetest.swap_node(fpos, {name = targetnode }) minetest.swap_node(fpos, {name = targetnode })
@ -66,7 +70,6 @@ minetest.register_tool("vivarium:staff_clone", { -- this will be the floor staff
if minetest.is_protected(pos, pname) then if minetest.is_protected(pos, pname) then
minetest.record_protection_violation(pos, pname) minetest.record_protection_violation(pos, pname)
print ("Protection violation")
return return
end end
@ -83,6 +86,10 @@ minetest.register_tool("vivarium:staff_clone", { -- this will be the floor staff
{x = pos.x + breadth, y = pos.y+relpos, z = pos.z + breadth}, {x = pos.x + breadth, y = pos.y+relpos, z = pos.z + breadth},
{"air"} {"air"}
) )
minetest.sound_play("vivarium_pom", {
pos = pos,
max_hear_distance = 10
})
for _,fpos in pairs(airnodes) do for _,fpos in pairs(airnodes) do
minetest.swap_node(fpos, {name = targetnode }) minetest.swap_node(fpos, {name = targetnode })