Add placement sound to lectern

This commit is contained in:
SmokeyDope 2023-02-25 10:59:05 +00:00
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