mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-09 01:03:50 +01:00
Add placement sound to lectern
This commit is contained in:
parent
d83c6fe906
commit
2d6e1c61a2
@ -96,6 +96,15 @@ local lectern_def = {
|
|||||||
local lectern_node = ItemStack(itemstack)
|
local lectern_node = ItemStack(itemstack)
|
||||||
-- Place the node!
|
-- Place the node!
|
||||||
local _, success = minetest.item_place_node(lectern_node, placer, pointed_thing, fdir)
|
local _, success = minetest.item_place_node(lectern_node, placer, pointed_thing, fdir)
|
||||||
|
|
||||||
|
-- Add placement sound.
|
||||||
|
local idef = lectern_node:get_definition()
|
||||||
|
if success then
|
||||||
|
if idef.sounds and idef.sounds.place then
|
||||||
|
minetest.sound_play(idef.sounds.place, {pos=above, gain=1}, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if not success then
|
if not success then
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user