diff --git a/mods/ITEMS/mcl_cauldrons/init.lua b/mods/ITEMS/mcl_cauldrons/init.lua index a9af26734c..32b122227e 100644 --- a/mods/ITEMS/mcl_cauldrons/init.lua +++ b/mods/ITEMS/mcl_cauldrons/init.lua @@ -4,15 +4,23 @@ mcl_cauldrons = {} -- Cauldron mod, adds cauldrons. local function give_item(user, itemstack) - if itemstack and user:is_player() and true then--minetest.is_creative_enabled(user:get_player_name()) then - if itemstack:get_count() == 1 then - return itemstack + if itemstack and user:is_player() then + local inv = user:get_inventory() + if false then --minetest.is_creative_enabled(user:get_player_name()) then + if inv:contains_item("main", itemstack) + return false + else + if inv:room_for_item("main", itemstack) then + inv:add_item("main", itemstack) + else + minetest.add_item(user:get_pos(), itemstack) + end + end else - local inv = user:get_inventory() if inv:room_for_item("main", itemstack) then inv:add_item("main", itemstack) else - minetest.add_item(user:get_pos(), new_bucket) + minetest.add_item(user:get_pos(), itemstack) end end end