Compare commits

...

1 Commits
dev ... main

Author SHA1 Message Date
Vitaliy Olkhin
f0ba412b5c исправлен звук 2024-11-30 14:55:53 +05:00

View File

@ -1,23 +1,17 @@
--_swap tool____________ --_swap tool____________
minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing) minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing)
pos.y = pos.y pos.y = pos.y --Непонятно зачем?
local name = minetest.get_node(pos).name local name = minetest.get_node(pos).name
if name ~= "default:sand" if name ~= "default:sand" and name ~= "default:silver_sand"
and name ~= "default:silver_sand"
and name ~= "default:desert_sand" then and name ~= "default:desert_sand" then
return return
end end
pos.y = pos.y pos.y = pos.y
if puncher:get_wielded_item():get_name() == "summer:rake" if puncher:get_wielded_item():get_name() == "summer:rake" then
then
minetest.remove_node(pos) minetest.remove_node(pos)
node.name = "summer:sabbia_mare" node.name = "summer:sabbia_mare"
minetest.set_node(pos, node) minetest.set_node(pos, node)
minetest.sound_play("summer_n_swap",{pos=pos, max_hear_distance=10})
minetest.sound_play("summer_n_swap", {
to_player = "",
gain = 2.0,})
end end
end ) end )
@ -38,12 +32,4 @@ groups = {crumbly = 3, falling_node = 1, sand = 1},
minetest.register_tool("summer:rake", { minetest.register_tool("summer:rake", {
description = "rake", description = "rake",
inventory_image = "rake.png", 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
})]]
}) })