SmallJoker
2022-06-06 0f6bdb1bde5f476b8e4500cba559f813cd5276a1
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
85a984 5 local load_start = os.clock()
S 6
49e82a 7 technic = rawget(_G, "technic") or {}
97e1c8 8 technic.creative_mode = minetest.settings:get_bool("creative_mode")
8e03d7 9
049129 10
5d470c 11 local modpath = minetest.get_modpath("technic")
S 12 technic.modpath = modpath
13
85a984 14
0a5e52 15 -- Boilerplate to support intllib
85a984 16 if rawget(_G, "intllib") then
4b1798 17     technic.getter = intllib.Getter()
E 18 else
0f6bdb 19     -- Intllib copypasta: TODO replace with the client-side translation API
S 20     technic.getter = function(s,a,...)
21         if a==nil then return s end
22         a={a,...}
23         return s:gsub("(@?)@(%(?)(%d+)(%)?)", function(e,o,n,c)
24             if e==""then
25                 return a[tonumber(n)]..(o==""and c or"")
26             end
27             return "@"..o..n..c
28         end)
29     end
4b1798 30 end
E 31 local S = technic.getter
82cba9 32
ee0765 33 -- Read configuration file
82cba9 34 dofile(modpath.."/config.lua")
ee0765 35
S 36 -- Helper functions
e23f87 37 dofile(modpath.."/helpers.lua")
82cba9 38
4f78a6 39 -- Items
82cba9 40 dofile(modpath.."/items.lua")
R 41
4f78a6 42 -- Craft recipes for items
ee0765 43 dofile(modpath.."/crafts.lua")
S 44
ee5c6c 45 -- Register functions
ee0765 46 dofile(modpath.."/register.lua")
ee5c6c 47
1da213 48 -- Radiation
S 49 dofile(modpath.."/radiation.lua")
50
5d470c 51 -- Machines
S 52 dofile(modpath.."/machines/init.lua")
82cba9 53
d49742 54 -- Tools
S 55 dofile(modpath.."/tools/init.lua")
56
ee0765 57 -- Aliases for legacy node/item names
S 58 dofile(modpath.."/legacy.lua")
82cba9 59
97e1c8 60 if minetest.settings:get_bool("log_mods") then
be2f30 61     print(S("[Technic] Loaded in %f seconds"):format(os.clock() - load_start))
ee0765 62 end
S 63