try to fix give function

This commit is contained in:
AFCMS 2021-03-19 14:58:25 +01:00
parent d00490c86f
commit 64b49ba719
1 changed files with 8 additions and 8 deletions

View File

@ -4,9 +4,9 @@ mcl_cauldrons = {}
-- Cauldron mod, adds cauldrons.
local function give_item(user, 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 then
--[[if false then --minetest.is_creative_enabled(user:get_player_name()) then
if inv:contains_item("main", itemstack) then
return false
else
@ -16,13 +16,13 @@ local function give_item(user, itemstack)
minetest.add_item(user:get_pos(), itemstack)
end
end
else
else]]
if inv:room_for_item("main", itemstack) then
inv:add_item("main", itemstack)
else
minetest.add_item(user:get_pos(), itemstack)
end
end
--end
end
return itemstack
end