fix mergeconflicts
This commit is contained in:
commit
8a3f06a18f
47 changed files with 1139 additions and 330 deletions
|
@ -1,8 +1,44 @@
|
|||
minetest.register_on_newplayer(function(player)
|
||||
--print("on_newplayer")
|
||||
if minetest.setting_getbool("give_initial_stuff") then
|
||||
minetest.log("action", "Giving initial stuff to player "..player:get_player_name())
|
||||
player:get_inventory():add_item('main', 'illuna:noobcoin 42')
|
||||
player:get_inventory():add_item('main', 'magical_potion:fly_small 2')
|
||||
end
|
||||
end)
|
||||
local stuff_string = minetest.settings:get("initial_stuff") or
|
||||
"illuna:noobcoin 42" ..
|
||||
"magical_potion:fly_small 2"
|
||||
|
||||
give_initial_stuff = {
|
||||
items = {}
|
||||
}
|
||||
|
||||
function give_initial_stuff.give(player)
|
||||
minetest.log("action",
|
||||
"Giving initial stuff to player " .. player:get_player_name())
|
||||
local inv = player:get_inventory()
|
||||
for _, stack in ipairs(give_initial_stuff.items) do
|
||||
inv:add_item("main", stack)
|
||||
end
|
||||
end
|
||||
|
||||
function give_initial_stuff.add(stack)
|
||||
give_initial_stuff.items[#give_initial_stuff.items + 1] = ItemStack(stack)
|
||||
end
|
||||
|
||||
function give_initial_stuff.clear()
|
||||
give_initial_stuff.items = {}
|
||||
end
|
||||
|
||||
function give_initial_stuff.add_from_csv(str)
|
||||
local items = str:split(",")
|
||||
for _, itemname in ipairs(items) do
|
||||
give_initial_stuff.add(itemname)
|
||||
end
|
||||
end
|
||||
|
||||
function give_initial_stuff.set_list(list)
|
||||
give_initial_stuff.items = list
|
||||
end
|
||||
|
||||
function give_initial_stuff.get_list()
|
||||
return give_initial_stuff.items
|
||||
end
|
||||
|
||||
give_initial_stuff.add_from_csv(stuff_string)
|
||||
if minetest.settings:get_bool("give_initial_stuff") then
|
||||
minetest.register_on_newplayer(give_initial_stuff.give)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue