diff --git a/mods/ITEMS/mcl_cauldrons/init.lua b/mods/ITEMS/mcl_cauldrons/init.lua index 7c86561978..18d1f1f86f 100644 --- a/mods/ITEMS/mcl_cauldrons/init.lua +++ b/mods/ITEMS/mcl_cauldrons/init.lua @@ -77,6 +77,14 @@ function mcl_cauldrons.get_cauldron_level(pos) return minetest.get_item_group(nn.name, "cauldron") end +function mcl_cauldrons.add_cauldron_level(pos, type, number) + local number = mcl_cauldrons.get_cauldron_level(pos) + number + if number > 4 then number = 4 end + if number < 1 then number = 1 end + mcl_cauldrons.set_cauldron_level(pos, type, number) + return number +end + function mcl_cauldrons.is_cauldron(name) return minetest.get_item_group(name, "cauldron") ~= 0 end @@ -153,15 +161,6 @@ function mcl_cauldrons.get_cauldron_string(type, level) end end -function mcl_cauldrons.add_cauldron_level(pos, type, number) - local nn = minetest.get_node(pos).name - local number = mcl_cauldrons.get_cauldron_level(pos)+number - if number > 4 then number = 4 end - if number < 1 then number = 1 end - mcl_cauldrons.set_cauldron_level(pos, type, number) - return number -end - function mcl_cauldrons.register_cauldron_type(def) for water_level = 1,3 do local id = "mcl_cauldrons:cauldron_"..def.name.."_"..water_level