forked from VoxeLibre/VoxeLibre
fix give function
This commit is contained in:
parent
294cb3eb7d
commit
8c91d23eb8
|
@ -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
|
||||
else
|
||||
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(), new_bucket)
|
||||
minetest.add_item(user:get_pos(), itemstack)
|
||||
end
|
||||
end
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue