diff --git a/sabbia.lua b/sabbia.lua index ae9be2d..6766cf9 100644 --- a/sabbia.lua +++ b/sabbia.lua @@ -1,25 +1,19 @@ --_swap tool____________ minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing) - pos.y = pos.y - local name = minetest.get_node(pos).name - if name ~= "default:sand" - and name ~= "default:silver_sand" - and name ~= "default:desert_sand" then - return - end - pos.y = pos.y - if puncher:get_wielded_item():get_name() == "summer:rake" - then + pos.y = pos.y --Непонятно зачем? + local name = minetest.get_node(pos).name + if name ~= "default:sand" and name ~= "default:silver_sand" + and name ~= "default:desert_sand" then + return + end + pos.y = pos.y + if puncher:get_wielded_item():get_name() == "summer:rake" then minetest.remove_node(pos) - node.name = "summer:sabbia_mare" - minetest.set_node(pos, node) - - minetest.sound_play("summer_n_swap", { - to_player = "", - gain = 2.0,}) - -end - end ) + node.name = "summer:sabbia_mare" + minetest.set_node(pos, node) + minetest.sound_play("summer_n_swap",{pos=pos, max_hear_distance=10}) + end +end ) --SABBIA @@ -38,12 +32,4 @@ groups = {crumbly = 3, falling_node = 1, sand = 1}, minetest.register_tool("summer:rake", { description = "rake", inventory_image = "rake.png", - [[on_place = function(itemstack, user, pointed_thing) - minetest.sound_play("summer_n_swap_2", { - to_player = user:get_player_name() , - gain = 2.0 - })]] - - - })