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