adventures/init.lua

57 lines
1.5 KiB
Lua
Raw Permalink Normal View History

2013-01-03 19:31:49 -08:00
--run Files
2013-01-05 20:56:30 -08:00
local file = io.open(minetest.get_worldpath().."/adventures_init", "r")
if(file == nil) then
print("Initialize")
io.output(minetest.get_worldpath().."/adventures_init")
io.write("initialized")
io.flush()
io.close()
io.output(minetest.get_worldpath().."/adventures_sources")
io.write("initialized")
io.flush()
io.close()
2013-01-24 20:21:29 -08:00
io.output(minetest.get_worldpath().."/adventures_books")
io.write("initialized")
io.flush()
io.close()
io.output(minetest.get_worldpath().."/adventures_checkpoints")
io.write("initialized")
io.flush()
io.close()
2013-02-01 09:59:41 -08:00
io.output(minetest.get_worldpath().."/adventures_quests")
io.write("initialized")
io.flush()
io.close()
2013-02-05 09:03:07 -08:00
io.output(minetest.get_worldpath().."/adventures_quests")
io.write("initialized")
io.flush()
io.close()
2013-01-05 20:56:30 -08:00
io.output(minetest.get_worldpath().."/adventures_previousmode")
io.write("initialized")
io.flush()
io.close()
2013-01-03 19:31:49 -08:00
end
local modpath=minetest.get_modpath("adventures")
dofile(modpath.."/global.lua")
local inv = minetest.create_detached_inventory("initialstuff", {
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
return count
end,
allow_put = function(inv, listname, index, stack, player)
return stack:get_count()
end,
allow_take = function(inv, listname, index, stack, player)
return stack:get_count()
end,
})
inv:set_size("main", 32)
2013-01-05 20:56:30 -08:00
dofile(modpath.."/decode.lua")
2013-01-03 19:31:49 -08:00
local creative = minetest.setting_get("creative_mode")
if creative == "1" then dofile(modpath.."/creative.lua")
2013-01-03 19:31:49 -08:00
else dofile(modpath.."/standard.lua")
2013-02-01 09:59:41 -08:00
end