add helper functio nto give item

This commit is contained in:
AFCMS 2021-03-27 12:16:08 +01:00
parent e3b3e2343b
commit 7156afcd03
1 changed files with 7 additions and 0 deletions

View File

@ -1,5 +1,12 @@
local has_doc = minetest.get_modpath(minetest.get_current_modname()) local has_doc = minetest.get_modpath(minetest.get_current_modname())
local function survival_give(user, itemstack)
if inv:room_for_item("main", itemstack) then
inv:add_item("main", itemstack)
else
minetest.add_item(user:get_pos(), itemstack)
end
end
local function give_item(user, itemstack) local function give_item(user, itemstack)
local inv = user:get_inventory() local inv = user:get_inventory()
if inv then if inv then