diff --git a/mods/ITEMS/mcl_buckets/init.lua b/mods/ITEMS/mcl_buckets/init.lua index 523b10ef9a..30e4075c86 100644 --- a/mods/ITEMS/mcl_buckets/init.lua +++ b/mods/ITEMS/mcl_buckets/init.lua @@ -92,7 +92,7 @@ function mcl_buckets.register_liquid(def) -- Check if pointing to a buildable node local item = itemstack:get_name() - if extra_check and extra_check(place_pos, user) == false then + if def.extra_check and def.extra_check(place_pos, user) == false then -- Fail placement of liquid elseif minetest.registered_nodes[nn] and minetest.registered_nodes[nn].buildable_to then -- buildable; replace the node diff --git a/mods/ITEMS/mcl_buckets/register.lua b/mods/ITEMS/mcl_buckets/register.lua index 1af9fcdba9..b5d86ac0e8 100644 --- a/mods/ITEMS/mcl_buckets/register.lua +++ b/mods/ITEMS/mcl_buckets/register.lua @@ -2,6 +2,20 @@ local S = minetest.get_translator(minetest.get_current_modname()) local mod_mcl_core = minetest.get_modpath("mcl_core") local mod_mclx_core = minetest.get_modpath("mclx_core") +local sound_place = function(itemname, pos) + local def = minetest.registered_nodes[itemname] + if def and def.sounds and def.sounds.place then + minetest.sound_play(def.sounds.place, {gain=1.0, pos = pos, pitch = 1 + math.random(-10, 10)*0.005}, true) + end +end + +local sound_take = function(itemname, pos) + local def = minetest.registered_nodes[itemname] + if def and def.sounds and def.sounds.dug then + minetest.sound_play(def.sounds.dug, {gain=1.0, pos = pos, pitch = 1 + math.random(-10, 10)*0.005}, true) + end +end + if mod_mcl_core then -- Lava bucket mcl_buckets.register_liquid({