This commit is contained in:
AFCMS 2021-03-18 19:43:25 +01:00
parent 3c83898095
commit 9b0c87dabc
1 changed files with 8 additions and 9 deletions

View File

@ -77,6 +77,14 @@ function mcl_cauldrons.get_cauldron_level(pos)
return minetest.get_item_group(nn.name, "cauldron") return minetest.get_item_group(nn.name, "cauldron")
end 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) function mcl_cauldrons.is_cauldron(name)
return minetest.get_item_group(name, "cauldron") ~= 0 return minetest.get_item_group(name, "cauldron") ~= 0
end end
@ -153,15 +161,6 @@ function mcl_cauldrons.get_cauldron_string(type, level)
end end
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) function mcl_cauldrons.register_cauldron_type(def)
for water_level = 1,3 do for water_level = 1,3 do
local id = "mcl_cauldrons:cauldron_"..def.name.."_"..water_level local id = "mcl_cauldrons:cauldron_"..def.name.."_"..water_level