MT-Modder
2015-03-01 b8c902868115a0a607da35e208a422e430d46317
commit | author | age
3bc6ca 1 -- Minetest 0.4.7 mod: technic
0ca19d 2 -- namespace: technic
R 3 -- (c) 2012-2013 by RealBadAngel <mk@realbadangel.pl>
82cba9 4
49e82a 5 technic = rawget(_G, "technic") or {}
b8c902 6 technic.creative_mode = minetest.setting_getbool("creative_mode")
8e03d7 7
049129 8 technic.tube_inject_item = pipeworks.tube_inject_item or function (pos, start_pos, velocity, item)
Z 9     local tubed = pipeworks.tube_item(vector.new(pos), item)
10     tubed:get_luaentity().start_pos = vector.new(start_pos)
11     tubed:setvelocity(velocity)
12     tubed:setacceleration(vector.new(0, 0, 0))
13 end
14
ee0765 15 local load_start = os.clock()
5d470c 16 local modpath = minetest.get_modpath("technic")
S 17 technic.modpath = modpath
18
0a5e52 19 -- Boilerplate to support intllib
4b1798 20 if minetest.get_modpath("intllib") then
E 21     technic.getter = intllib.Getter()
22 else
23     technic.getter = function(s,a,...)if a==nil then return s end a={a,...}return s:gsub("(@?)@(%(?)(%d+)(%)?)",function(e,o,n,c)if e==""then return a[tonumber(n)]..(o==""and c or"")else return"@"..o..n..c end end) end
24 end
25 local S = technic.getter
82cba9 26
ee0765 27 -- Read configuration file
82cba9 28 dofile(modpath.."/config.lua")
ee0765 29
S 30 -- Helper functions
e23f87 31 dofile(modpath.."/helpers.lua")
82cba9 32
ee0765 33 -- Items 
82cba9 34 dofile(modpath.."/items.lua")
R 35
ee0765 36 -- Craft recipes for items 
S 37 dofile(modpath.."/crafts.lua")
38
ee5c6c 39 -- Register functions
ee0765 40 dofile(modpath.."/register.lua")
ee5c6c 41
5d470c 42 -- Machines
S 43 dofile(modpath.."/machines/init.lua")
82cba9 44
d49742 45 -- Tools
S 46 dofile(modpath.."/tools/init.lua")
47
ee0765 48 -- Aliases for legacy node/item names
S 49 dofile(modpath.."/legacy.lua")
82cba9 50
37c06a 51 if minetest.setting_getbool("log_mods") then
be2f30 52     print(S("[Technic] Loaded in %f seconds"):format(os.clock() - load_start))
ee0765 53 end
S 54