mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-16 16:11:06 +01:00
Add placement sounds to twisting vines and weeping vines
This commit is contained in:
parent
62bb7a85eb
commit
f971283798
1 changed files with 20 additions and 0 deletions
|
@ -129,7 +129,17 @@ minetest.register_node("mcl_crimson:twisting_vines", {
|
|||
if not minetest.is_creative_enabled(clicker:get_player_name()) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
--placement checks sucess, put twisting vine
|
||||
grow_vines(pos, 1, "mcl_crimson:twisting_vines")
|
||||
--add sound to vine placement
|
||||
local idef = itemstack:get_definition()
|
||||
local itemstack, success = minetest.item_place_node(itemstack, placer, pointed_thing)
|
||||
if success then
|
||||
if idef.sounds and idef.sounds.place then
|
||||
minetest.sound_play(idef.sounds.place, {pos=above, gain=1}, true)
|
||||
end
|
||||
end
|
||||
|
||||
elseif clicker:get_wielded_item():get_name() == "mcl_bone_meal:bone_meal" then
|
||||
if not minetest.is_creative_enabled(clicker:get_player_name()) then
|
||||
itemstack:take_item()
|
||||
|
@ -186,7 +196,17 @@ minetest.register_node("mcl_crimson:weeping_vines", {
|
|||
if not minetest.is_creative_enabled(clicker:get_player_name()) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
--placement check sucess, grow weeping vine
|
||||
grow_vines(pos, 1, "mcl_crimson:weeping_vines", -1)
|
||||
--add sound to placement
|
||||
local idef = itemstack:get_definition()
|
||||
local itemstack, success = minetest.item_place_node(itemstack, placer, pointed_thing)
|
||||
if success then
|
||||
if idef.sounds and idef.sounds.place then
|
||||
minetest.sound_play(idef.sounds.place, {pos=above, gain=1}, true)
|
||||
end
|
||||
end
|
||||
|
||||
elseif clicker:get_wielded_item():get_name() == "mcl_bone_meal:bone_meal" then
|
||||
if not minetest.is_creative_enabled(clicker:get_player_name()) then
|
||||
itemstack:take_item()
|
||||
|
|
Loading…
Reference in a new issue