fix give function

This commit is contained in:
AFCMS 2021-03-19 14:26:43 +01:00
parent 294cb3eb7d
commit 8c91d23eb8
1 changed files with 13 additions and 5 deletions

View File

@ -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