forked from VoxeLibre/VoxeLibre
add helper functio nto give item
This commit is contained in:
parent
e3b3e2343b
commit
7156afcd03
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue