2017-05-16 00:45:40 +02:00
|
|
|
--
|
|
|
|
-- Gives initial stuff
|
|
|
|
-- By Kaadmy, for Pixture
|
|
|
|
--
|
|
|
|
|
|
|
|
local give_initial_enable = minetest.setting_getbool("give_initial_enable")
|
|
|
|
local give_initial_items = util.split(minetest.setting_get("give_initial_items"), ",")
|
|
|
|
|
|
|
|
local function on_newplayer(player)
|
2017-05-16 04:49:05 +02:00
|
|
|
if give_initial_enable then
|
2017-05-16 00:45:40 +02:00
|
|
|
local inv = player:get_inventory()
|
|
|
|
|
|
|
|
for _, itemstring in ipairs(give_initial_items) do
|
|
|
|
inv:add_item("main", itemstring)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
minetest.register_on_newplayer(on_newplayer)
|
|
|
|
|
|
|
|
default.log("mod:give_initial", "loaded")
|