From 5df668f6af474c56dfe72dfadc177dfe67f3e0c0 Mon Sep 17 00:00:00 2001 From: AFCMS Date: Wed, 17 Mar 2021 16:56:46 +0100 Subject: [PATCH] fix mcl_buckets extra_check #1320 --- mods/ITEMS/mcl_buckets/init.lua | 2 +- mods/ITEMS/mcl_buckets/register.lua | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_buckets/init.lua b/mods/ITEMS/mcl_buckets/init.lua index 523b10ef9..30e4075c8 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 1af9fcdba..b5d86ac0e 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({